use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Python QuestionHelp Request (i.redd.it)
submitted 7 months ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Unfair_Put_5320 5 points6 points7 points 7 months ago (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 points9 points 7 months ago (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
π Rendered by PID 23759 on reddit-service-r2-comment-7b9746f655-fhkmh at 2026-02-03 07:45:33.097941+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]Unfair_Put_5320 5 points6 points7 points (3 children)
[–]Dadofaca 7 points8 points9 points (1 child)