该程序的重点是询问用户的姓名(首字母自动大写)。
然后它会询问年龄和性别。如果年龄超过 130 或为负数,则会抛出错误
该程序应该打印出所有信息,但我无法弄清楚while循环条件。谁能帮我弄清楚while循环条件?
-edit- 虽然Pastebin 的链接已被删除,但我认为那里有重要信息。所以,我还是会给你链接: http: //pastebin.com/UBbXDGSt
name = input("What's your name? ").capitalize()
age = int(input("How old are you "))
gender = input("From what gender are you? ").capitalize()
while #I guess I should write something behind the "while" function. But what?
if age >= 130:
print("It's impossible that you're that old. Please try again!")
elif age <= 0:
print('''It should be logical that ages are written in positive numbers! Well, try again! =)''')
age = int(input("How old are you? "))
print("Your name is ",name, ". You are ", age, "years old." "\nYou are ", gender, ".")