I need to write the data below in python,
student score
Bill 43
Suzy 54
Sally 41
but I have to flip it too look like
student Bill Suzy Sally
score 43 54 41
I have this written already,
ofile = open('grades','r')
Tfile = open('Tgrades','u')
date = []
while 1:
a = ofile.readline()
if a=='':
break
data.append(a.split())
with open ('yourfile') as fin:
lines = (line.split() for line in fin)
for row in zip(*lines):
print ' '.join(row)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With