嗨,我正在做一个学校作业,使用Pycharm代码如下:
import datetime
name = input("What is your name? Adam")
age = int(input("How old are you? 32"))
year = datetime.datetime.now().year
print("Hello! Adam you were born in" + str((year - age)))
字符串
当我运行代码时,我一直得到这个错误,
C:\Users\akuli\PycharmProjects\pythonProject1\venv\Scripts\python.exe C:\Users\akuli\PycharmProjects\pythonProject1\derp.der.py
AdamTraceback (most recent call last):
File "C:\Users\akuli\PycharmProjects\pythonProject1\derp.der.py", line 1, in <module>
name = input('Adam')
^^^^^^^^^^^^^
File "<frozen codecs>", line 319, in decode KeyboardInterrupt
型
我已经试着改变代码几次才慢慢开始失去我的头脑有任何帮助吗?
我试着重写我的代码几次,只是为了得到同样的结果。当我运行模块时,它似乎只是停在第一行,而不是贯穿它们
1条答案
按热度按时间xfyts7mz1#
您在终端中有一个空行,但它正在等待您输入要读取的值。输入值: