Aug-21-2020, 12:02 AM
readline()
returns a string of characters. You're probably just printing out that long string. When you ask a string for its length, it reports the number of characters inside.
>>> s = "20 40 80 200 250" >>> len(s) 16
split()
will break it into separate strings (default it breaks on whitespace).>>> s.split() ['20', '40', '80', '200', '250'] >>> len(s.split()) 5