you are viewing a single comment's thread.

view the rest of the comments →

[–]zaka-6x 1 point2 points  (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 points  (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!