create a program that gets the marks the user has for their classes this year. Tell them how many
classes they are failing (despite what many o
f you think a fail is 50%)
Save
as
Name_Surname_Repetition_Problem1.py................i seriuosly need help with this program,python is giving me a hard tym

Hint:

# assume this is your data file (CSV type)
# each line has last name, first name, grade
data = '''\
Miller,Jean,75
Paulson,Peter,47
Tanner,Abraham,88
Norton,Sheila,33
'''

filename = "grades123.txt"
# write a test file
with open(filename, "w") as fout:
    fout.write(data)

# now read your test file back in and process the data
with open(filename, "r") as fin:
    for line in fin:
        # remove trailing newline char
        line = line.rstrip()
        # split the line at the commas
        line_list = line.split(",")
        print(line, line_list)  # test
        # unpack the line
        last, first, grade = line_list
        # now check if int(grade) <= 50
        # and tell person (last first) if they failed

You will have to work with more than one grade in your data line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.