- #1
acurate
- 17
- 1
Homework Statement
I need a program (in PYTHON), which would ask a user his name and grade, then print them both. 1) If the name has a number it, the program has to ask the same question again until the name is entered correctly 2) The same with the grade. If it's higher than 10, the program has to keep on asking the same request.
Homework Equations
The Attempt at a Solution
Python:
while True:
name = input("Enter a student's name:" )
for digit in name:
if digit.isdigit():
#don't know what to do here and how to continue
grade = input("Enter a grade: ")
if grade > 10:
# i need the program to do the same thing as in the name
# if the grade is higher than 10 the program needs to keep loopong the input
print (name, grade)
Last edited by a moderator: