I have a flat file in txt format seperated by space.
ID Math Eng Phy
A 70 75 77
B 56 79 80
C 90 89 56
I need to compare each number if its less than 70. What i am doing : I am able to store this file in dictionary but when i am comparing number getting :
"if int(m) < 70:ValueError: invalid literal for int() with base 10: 'Math' "
error. Below is my code:
with open('student.txt','r') as file:
rows = ( line.split('\t') for line in file )
d = { row[0]:row[1:] for row in rows }
for l in d:
print(l,d[l])
for m in d[l]:
if int(m) < 70:
print(m)