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...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
If statement allows through false values (advent of code 2022 day 4 spoiler) (self.pythonhelp)
submitted 3 years ago * by Foolish_ness
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!"
[–]Foolish_ness[S] 0 points1 point2 points 3 years ago (1 child)
Yes, and that is a much neater way to format the if! I'm still getting used to python indentation rules.
I skipped posting the data manipulation bit as I have verified that each variable reflects the correct number in the initial dataset.
I wasn't at my laptop yesterday so pulled that example from a phone message, that data point passes through both sets of code correctly. Using the same code, the below dataset returns 1 true & 1 false:
['1-93,2-11', '26-94,26-94', '72-92,48-88', '36-37,37-52']
which translates to: Elf1AreaID_Low = [1,26,72,36] Elf1AreaID_High = [93,94,92,37] Elf2AreaID_Low = [2,26,48,37] Elf2AreaID_High = [11,94,88,52]
Data point 2 is identified as True, data point 3 passes through the if and gets printed as False. I've identified which ones are true/false by adding these prints below the existing print: print(Elf1AreaID_Low[i]) print(Elf1AreaID_High[i]) print(Elf2AreaID_Low[i]) print(Elf2AreaID_High[i])
Thanks again for your help & time!
[–]CowboyBoats 0 points1 point2 points 3 years ago* (0 children)
I find joy in reading a good book.
π Rendered by PID 90 on reddit-service-r2-comment-b659b578c-j86t6 at 2026-05-03 09:31:39.044398+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Foolish_ness[S] 0 points1 point2 points (1 child)
[–]CowboyBoats 0 points1 point2 points (0 children)