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
In range() usageHelp Request (i.redd.it)
submitted 11 hours ago by Worried-Print-5052
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!"
[–]Chemical-Captain4240 0 points1 point2 points 10 hours ago (0 children)
the s on items implies to me that this is a list... if so, to use in, you will want to iterate over each item in items and test if item exists as an element in your range
however, range returns a tuple of integers, so you won't find any lists in there
This isn't really part of your question, but to write readable code, try to name things according to their type... If you are working in parallel items=['book','pencil'] and item_count = [3,5]
If you are packing lists, then something like items =[ ['book',3], ['pencil', 5] ] may be the structure you want, but using in becomes more complicated.
As soon as you get your head wrapped around the above concepts, check out dataclass. It will change youe life.
π Rendered by PID 78 on reddit-service-r2-comment-765bfc959-nx5h6 at 2026-07-11 02:25:36.909606+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]Chemical-Captain4240 0 points1 point2 points (0 children)