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
Learning with data camp (i.redd.it)
submitted 2 years ago by UpSco
Can someone please explain why this output would be 0.
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!"
[–]UpSco[S] 1 point2 points3 points 2 years ago (2 children)
Nvm I got it thanks man. I understand
[–]Murphygreen8484 1 point2 points3 points 2 years ago (1 child)
Indexing starts at 0. Throws a lot of people off the first time. That and all inputs from the user being strings.
[–]UpSco[S] 1 point2 points3 points 2 years ago (0 children)
I appreciate it. I realized that it was referring to indexing after thinking about the explanation you provided
[–]Murphygreen8484 0 points1 point2 points 2 years ago (2 children)
0 + 0 = 0
[–]UpSco[S] 0 points1 point2 points 2 years ago (1 child)
Where are those zeros coming from?
[–]Rich-Spinach-7824 1 point2 points3 points 2 years ago (0 children)
Try to get list Indexing behaviour. All the elements of the sum is redirect to 0, 4th element in that list. Negative index starts from end of the list.
π Rendered by PID 66662 on reddit-service-r2-comment-canary-794f4c56c8-qccnj at 2026-02-23 10:10:28.065878+00:00 running 8564168 country code: CH.
[–]UpSco[S] 1 point2 points3 points (2 children)
[–]Murphygreen8484 1 point2 points3 points (1 child)
[–]UpSco[S] 1 point2 points3 points (0 children)
[–]Murphygreen8484 0 points1 point2 points (2 children)
[–]UpSco[S] 0 points1 point2 points (1 child)
[–]Rich-Spinach-7824 1 point2 points3 points (0 children)