0

python- i can't use splitlines() method

I was trying to calculate average and standart deviation of the exam results using python. Each line has the form [10 digit school number][space][1 or 2 digit mid term 1 result][space][1 or 2 digit mid term 2 result] But i could not use the splitlines method it is not working in the following way: a=str(1234567890 10 20 1234567809 12 30) b=a.splitlines() print(b)

5th Aug 2018, 8:31 PM
ali
2 Answers
+ 1
Because your integer value has whitespaces.
5th Aug 2018, 8:41 PM
Toni Isotalo
Toni Isotalo - avatar
0
splitlines splits based on '\n' your string has none. you also can us str() with whitespace
5th Aug 2018, 10:29 PM
JME