Another beautiful day in this miserable world

Python Programming


#A certain CS professor gives 5-point quizzes that are graded on the scale
#5-A, 4-B, 3-C, 2-D, 1-F, 0-F. Wirte a program that accepts a quiz score
#as an input and prints out the corresponding grade.
def main():
    grade = eval(input("What is your quiz score? (Type quit to stop) "))
        if grade == 5:
            letter = 'A'
        if grade == 4:
            letter = 'B'
        if grade == 3:
            letter = 'C'
        if grade == 2:
            letter = 'D'
        if grade == 1 or grade == 0:
            letter = 'F'
        print(" Your grade is a ", letter)
main()

Advertisement

Comments on: "Python Programming" (1)

  1. I just wanted to thank you for helping me this semester..I stumbled here by accident but very glad i did. It really helps to see a functioning program sometimes but aside from all the programming…i just wanted to say you are HILARIOUS!!! and seem like a very cool person…That bit about what a programmer is really thinking was really on point…programming doesnt seem that funny when your not posting…Hope all is well

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Tag Cloud

Follow

Get every new post delivered to your Inbox.