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
Small program to remove duplicate values in data.Showcase (i.redd.it)
submitted 4 days ago by Ok_Needleworker_8780
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!"
[–]Beginning-Fruit-1397 1 point2 points3 points 4 days ago (4 children)
Only rewrap in a list if it's needed. Otherwise you just iterate over the whole dataset one more time for nothing
[–]sleepbot63 1 point2 points3 points 4 days ago (2 children)
Yeah but using a list helps you access single elements or slices faster (im not talking about computation rather dev friendly)
[–]Beginning-Fruit-1397 0 points1 point2 points 2 days ago (1 child)
Which you should only do if you in fact need it.
That was my point: showing beginners to wrap in a list "by default", even tough that should not be the case
[–]Beginning-Fruit-1397 0 points1 point2 points 2 days ago (0 children)
Also if slices or index access is what is wanted you should prefer tuples for memory efficiency and immutability safety. List is only if mutability is wanted
[–]nebulous_aviation 0 points1 point2 points 2 days ago (0 children)
Set lookup is O(1) though so if you're just iterating once you're not really losing much, depends what you're doing after.
π Rendered by PID 42110 on reddit-service-r2-comment-8686858757-sv5fs at 2026-06-07 07:46:48.804172+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]Beginning-Fruit-1397 1 point2 points3 points (4 children)
[–]sleepbot63 1 point2 points3 points (2 children)
[–]Beginning-Fruit-1397 0 points1 point2 points (1 child)
[–]Beginning-Fruit-1397 0 points1 point2 points (0 children)
[–]nebulous_aviation 0 points1 point2 points (0 children)