I'm getting a syntax error when I attempt to run my program and the print in the last line is highlighted in red.我不明白为什么会有语法错误。
# 6. Calculate the radius of the circle using the
# distance formula on a given point and the center
r = math.sqrt((a-x)** + (b-y)**
# 7. Output to the shell the location of the center
# of the circle
print("The center of the circle is at (",x,",", y,")",sep="")
# 8. Output to the shell the radius of the circle
print("The radius of the circle is " , r)
I'm getting a syntax error when I attempt to run my program and the print in the last line is highlighted in red. I don't understand why there is a syntax error.
# 6. Calculate the radius of the circle using the
# distance formula on a given point and the center
r = math.sqrt((a-x)** + (b-y)**
# 7. Output to the shell the location of the center
# of the circle
print("The center of the circle is at (",x,",", y,")",sep="")
# 8. Output to the shell the radius of the circle
print("The radius of the circle is " , r)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
continue
should probably be
The missing closing paren makes the expression spread out to the following lines. Up to the
print()
call in the last line, the expression conforms to Python's grammar (even if this appears surprising at first).