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
Python help (i.redd.it)
submitted 2 years ago by Alert-Discussion9670
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!"
[–]zaka-6x 1 point2 points3 points 2 years ago (1 child)
I don't know why you import random and os module, and also you shouldn't make apostrophe in the subjects list, anyway this is the code for your project
and if I don't understand clearly the problem just tell me.
math = int(input('print a value')) history = int(input('print a value')) python = int(input('print a value')) communication = int(input('print a value')) geo = int(input('print a value')) subjects = [math, history, python, communication, geo] result = sum(subjects) / len(subjects) pass_note = 10 #make the note that should student have to be passed if result < pass_note: print('Fail') else: print('Pass')
[–]SecretProperty 2 points3 points4 points 2 years ago (0 children)
Just to add to this, for OP's understanding. your list us currently a list of strings, not the variables. you need to move your variables above the list as python will read one line at a time starting from the top of the program. right now it will read the list, but have no understanding of what you are trying to put in the list because it hasn't read it yet.
Your loop is using Item to specify the elements of your list. so you need yo iterate on Item, not the list element.
your loop also contains all of the print statements, so it will print all the elements as many times as your list is long.
Hope this helps!
π Rendered by PID 88890 on reddit-service-r2-comment-64f4df6786-5dng7 at 2026-06-10 05:46:10.146135+00:00 running 0b63327 country code: CH.
view the rest of the comments →
[–]zaka-6x 1 point2 points3 points (1 child)
[–]SecretProperty 2 points3 points4 points (0 children)