-1
我试图创建一个程序,要求用户输入年份Haley的彗星最后一次出现,然后再添加75和76年,然后输出结果。无法将int int更改为str隐藏
lastsight = int(input("When was the last sighting? "))
firstsight = lastsight + 75
secondsight = lastsight + 76
print("The next sighting will be in", firstsight, "or", secondsight + ".")
但是,每当我运行它,我得到这个错误:
Traceback (most recent call last):
File "program.py", line 5, in <module>
print("The next sighting will be in", firstsight, "or", secondsight + ".")
TypeError: unsupported operand type(s) for +: 'int' and 'str'
我如何能解决这个问题的任何帮助,将不胜感激。