我对编程非常陌生,并试图搞乱输入。几周前我写了一个简单的生日计算器:
name = " # name"
bday = # year of birth
current_year = 2020
age = current_year - bday
print(name.title() + " will turn:")
print(age)
print("this year")
我决定通过使用实际输入来改进这个概念,并开始在 Sublime 中进行尝试。它允许我输入名称,但是当我按回车键时,什么也没有发生。
这是程序的输入版本:
current_year = 2020
name = str(input("what is the name: "))
bday = str(input("what year were they born in: "))
age = curent_year - bday
print(name.title() + " will turn:")
print(age)
print("this year")
梵蒂冈之花
相关分类