Commit a184df07 authored by ARUNAVO KUMAR MONDAL's avatar ARUNAVO KUMAR MONDAL

done task 3 anded only task3.py

parent 2d162947
def f():
t=open('mat.txt','r')
l = [map(int, line.split(' ')) for line in t ]
r=l[0][0];
c=l[0][1];
b=[['None']*c for _ in range(r)]
b=l[1:];
trans=[list(i) for i in zip(*b)]
f=open("transpose.txt","wb")
f.write(str(c)+" "+str(r)+'\n')
for i in range(c):
s=""
for j in range(r):
s=s+str(trans[i][j])+" "
f.write(s+'\n')
f.close()
f()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment