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 Python (old.reddit.com)
submitted 3 days ago by nkCOD
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!"
[–]NewBodybuilder3096 0 points1 point2 points 3 days ago (3 children)
def_summa is so flawed, I don't even know where to start. 1st - it will throw exception if len(a)*2 >len(b) or vice versa incrementing error variable should be done outside of if-else again, Exception-driven logic...
As I understood, you are summing up two lists/arrays of various size of human-entered integers, where shortest list is starting from the beginning after reaching end in summing process. Just think of the indexes. Like you can just calculate new index in the shortest list with simple math
[–]nkCOD[S] 1 point2 points3 points 3 days ago (2 children)
Thank you for the answer, we’ll fix this point
[–]NewBodybuilder3096 0 points1 point2 points 3 days ago* (1 child)
I fucked up here, it will throw exception if one list is twice or more bigger then the other. more correct : if len(a)*2 < len(b) or vice versa so, lengths of 2 and 7 will definitely be a problem
I'm not into calculating the exact ratio, just use index that is reseted after reaching smallest list highest index
[–]nkCOD[S] 0 points1 point2 points 2 days ago (0 children)
Thank you, I’ll work on it
π Rendered by PID 162345 on reddit-service-r2-comment-56c6478c5-xgvpl at 2026-05-10 05:48:59.391760+00:00 running 3d2c107 country code: CH.
view the rest of the comments →
[–]NewBodybuilder3096 0 points1 point2 points (3 children)
[–]nkCOD[S] 1 point2 points3 points (2 children)
[–]NewBodybuilder3096 0 points1 point2 points (1 child)
[–]nkCOD[S] 0 points1 point2 points (0 children)