0% found this document useful (0 votes)
6 views3 pages

FDS - Trans 1 Rohini

Fds practical

Uploaded by

Sakshi Bhosale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

FDS - Trans 1 Rohini

Fds practical

Uploaded by

Sakshi Bhosale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Kolekar Rohini Murlidhar

Class: S.E Computer

Div: B

row = int(input(Enter the number of rows:)

col = int(input(Enter the number of columns:)

a = []

# Initialize matrix

matrixa = []

matrixb = []

result = []

print(Enter the entries rowwise:)

# For user input

for i in range(row): # A for loop for row entries

a = []

for j in range(col): # A for loop for column entries

a.append(int(input()))

matrixa.append(a)

# For printing matrix

for i in range(row):

for j in range(col):

print(matrixa[i][j], end=)

print()

# result matrix

for i in range(col):

a = []

for j in range(row):

a.append(0)

result.append(a)

for i in range(col):

for j in range(row):
print(result[i][j], end=)

print()

# transpose of matrix

for i in range(row):

for j in range(col):

result[j][i] = matrixa[i][j]

# print result

print("Result matrix for transpose of matrix is:)

for i in range(col):

for j in range(row):

print(result[i][j], end)

print()

Enter the number of rows:2

Enter the number of columns:2

Enter the entries rowwise:

12

34

Result matrix for transpose of matrix is:

13

24

Output:

Enter the number of rows:3

Enter the number of columns:3

Enter the entries rowwise:


1

132

548

769

Result matrix for transpose of matrix is:

157

346

289

You might also like