首页 > 解决方案 > 使用第一个程序在 python 中获取语法错误

问题描述

所以,我刚刚开始尝试学习 Python,我正在关注一本名为:Automate the Boring Stuff with Python的“书” 。我正在做书中的第一个程序,我认为一切都很好......但现在我遇到了一个错误,我无法弄清楚为什么。

# This Program says hello and ask for my name.

print('Hello world!')
print('What is your name?') # ask fo their name
myName = input()
print('It is good to meet you, ' + myName)
print('The length of your name is:')
print(len(myName)
print('What is your age?') # ask for thier age
myAge = input()
print('You will be ' +str(int(myAge) + 1) + ' in a year.')

VS Code 从第 9 行开始显示错误,但我终其一生都无法弄清楚。任何帮助将不胜感激。

谢谢。

标签: pythonpython-idle

解决方案


print(len(myName) 失踪 ')'。


推荐阅读