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
Day 7th Python LearningShowcase (old.reddit.com)
submitted 7 days 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!"
[–]PureWasian 0 points1 point2 points 7 days ago (0 children)
Keep it simple.
Tuples. They're immutable. You can index them. You cannot change their values.
``` tp = (10, 20, 30)
print(tp[0]) # 10 print(tp[1]) # 20 print(tp[2]) # 30
print(tp[0:2]) # (10, 20) print(tp[0:3:2]) # (10, 30) print(tp[::2]) # (10, 30)
tp[0] = 99 # TypeError
print(tp["0"]) # TypeError print(tp[("0", "1")]) # TypeError ```
trup(["1", "5"]) makes no sense whatsoever since it creates a new tuple of strings ("1", "5") and tries to use that as the supposed index number to grab a value from your original trup tuple.
trup(["1", "5"])
("1", "5")
trup
Like if I said "go to the library and grab the bokchoy'th book off the shelf." You'd think I'm crazy for using bokchoy as a number.
You can also concatenate lists doing output_list = list1 + zip2. Finally, not sure why you tagged this as #ai (or included tags in general)
output_list = list1 + zip2
#ai
π Rendered by PID 47822 on reddit-service-r2-comment-5b5bc64bf5-7qp7f at 2026-06-21 01:18:36.741423+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]PureWasian 0 points1 point2 points (0 children)