Commit aabca92c authored by ORSU AKHIL's avatar ORSU AKHIL

task B3

parent 65ce4ac4
def function2(list,n) :
newlist = [ k[n] for k in list]
#print (newlist)
#sortlist=newlist.sort()
return newlist
input=[]
m = open ("matrix.txt")
tempind=m.readline()
index=[int(x) for x in tempind.split()]
row=index[0]
column=index[1]
newrow=str(column)
newcolumn=str(row)
a = open("transpose.txt","w+")
a.write(newrow+" "+newcolumn+"\n")
for akih in range(row):
temp=m.readline()
temprow = [int(x) for x in temp.split()]
input.append(temprow)
#mysr = " ".join(str(any) for any in temprow)
#a.write(mysr+"\n" )
m.close()
x=0
for x in range(column):
ak = function2(input,x)
mysr = " ".join(str(any) for any in ak)
a.write(mysr+"\n" )
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