I am new in Python, however I am not a student learning programming. I just thought that learning how to code is a fun thing to do. I have the latest version in 32-bit installed in Windows 8.1.
Today I made a code that prints out a name of a student and his corresponding score. Here is my code:
Sorry if my post is badly formatted, this is my first post. And python is fun :)
Today I made a code that prints out a name of a student and his corresponding score. Here is my code:
print("Enter the name and scores of your students.") name = str(input("Enter name: ")) score = int(input("Enter score: ")) while score != 0 and score != 1 and score != 2 and score != 3 and score != 4 and score != 5: print("Only numbers 0 to 5 are acceptable!") score = int(input("Enter score: ")) print() else: if score == 0: print(name,"got a grade of F.") elif score == 1: print(name,"got a grade of E.") elif score == 2: print(name,"got a grade of D.") elif score == 3: print(name,"got a grade of C.") elif score == 4: print(name,"got a grade of B.") elif score == 5: print(name,"got a grade of A.")I want to include another line below which requires an input, that gives option whether the user would still like to use the program or to exit. The problem comes with looping this whole set of codes. If it is possible, how can I do it? Thanks for the help.
Sorry if my post is badly formatted, this is my first post. And python is fun :)