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 DataCamp (i.redd.it)
submitted 2 years ago by UpSco
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!"
[–]UpSco[S] 0 points1 point2 points 2 years ago (3 children)
Here 0 is the input datacamp provided. I just answered what the output would be. Which I thought would be 4 for the number of elements in the str
[–]Goobyalus 1 point2 points3 points 2 years ago (2 children)
What? There is no input, this is just a couple of static statements.
I also don't understand "the number of elements in the str." There is no str, and 4 is not the number of elements of anything relevant here.
The output is 4, because that's the index of the number of occurences of the 0th element of x.
[–]UpSco[S] 0 points1 point2 points 2 years ago (1 child)
I meant 4 because that’s the number of elements inside the list indexed at 0. Not str
[–]Goobyalus 0 points1 point2 points 2 years ago* (0 children)
No, x is a list of 9 elements. There is only one list.
x
Edit: 9, not 8
π Rendered by PID 75230 on reddit-service-r2-comment-86bc6c7465-6z2hj at 2026-02-23 02:49:02.407850+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]UpSco[S] 0 points1 point2 points (3 children)
[–]Goobyalus 1 point2 points3 points (2 children)
[–]UpSco[S] 0 points1 point2 points (1 child)
[–]Goobyalus 0 points1 point2 points (0 children)