Multiple Arguments in an Input?

前端 未结 3 1653
死守一世寂寞
死守一世寂寞 2021-01-25 16:50

Beginner Programmer here. I\'m trying to write a program that will ask a user for a quiz grade until they enter a blank input. Also, I\'m trying to get the input to go from disp

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-25 17:44

    Of course, it is easy to make the variable within the str () function to convert it from a number to a string and to separate all the arguments using "+" and do not use "-" where programmatically when using "+" Python will be considered as one string

    grade = input ("quiz 1: ")
    count = 1
    while grade != "" :
        count += 1
        grade = input ("quiz "+ str(count) + ": ")
    

提交回复
热议问题