Dec-13-2020, 07:08 AM
And for your original code:
* You're comparing line.isspace, not line.isspace()
* line.isspace() is only true if the entire line is spaces.
* You're updating
I suspect you intended the inner while to instead be
But the
* You're comparing line.isspace, not line.isspace()
* line.isspace() is only true if the entire line is spaces.
* You're updating
start
, but your inner while doesn't change the comparison.I suspect you intended the inner while to instead be
if line[start].isspace() == False:
But the
split()
version is better.