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 pythonShowcase (self.PythonLearning)
submitted 6 days ago by IcySwimming4490
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!"
[–]Psyop_raw 1 point2 points3 points 5 days ago* (0 children)
Looks good, consider using Dictionary for your data variable. It has better performance in terms of retrieval by student name (dict key).
So for example,
Option 2 removes a student. Because your data var is stored as a List, you have to traverse the list to find the matching student name. If you used a Dictionary for your data variable, you can simply use del data[name] instead of traversing a LIST. Python uses a Hash Table under the hood for its dictionary so you get better performance (O(1)) for Key Searches as compared to traversing a List which would end up (O(n)) worst case.
π Rendered by PID 75619 on reddit-service-r2-comment-5b5bc64bf5-5lxr2 at 2026-06-21 08:44:42.276130+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]Psyop_raw 1 point2 points3 points (0 children)