How can I increment the input statement in python? -
my question how show "student 1 name," "student 2 name" etc goes through loop 12 names?
students = 12 x in range(students): name = str(input('student name: ')) grade = int(input('enter average grade: '))
to add andrew li's comment, can append string directly in python using "+" operator:
in case don't want use format method, can try this:
name = input("student " + str(x + 1) + " name: ")
Comments
Post a Comment