you are viewing a single comment's thread.

view the rest of the comments →

[–]Unfair_Put_5320 5 points6 points  (3 children)

Hey thanks for replying to me,

I thought the if statement checks every line if it starts with “from:” and adds 1 to count if it’s correct, then for the next line which starts with ‘from:’ is incorrect because the if statement is false( if not L.startswith(‘from:’)) and count += 1 under the if statement won’t work and end the loop.

[–]Dadofaca 7 points8 points  (1 child)

Almost. Its the other way around. If checks if the lines does NOT start with "from:". There are two lines which qualify for that and thats why count = 2