我无法导入以下城市: 日内瓦 比拉赫 等。
我已经尝试过Stackoverflow上的解决方案,但似乎没有任何效果。你有适合你的东西吗?
谢谢。
答案 0 :(得分:1)
尝试导入文件,并在def bet():
my_bet = -1
while my_bet < 0 or my_bet > 49:
print("before input")
my_bet = input("Enter a bet: ")
print("after input")
try:
my_bet = int(my_bet)
if my_bet < 0 or my_bet > 49:
print("Bet must be between 0 and 49")
except:
print("Need a number between 0 and 49")
continue
return my_bet
函数中为>>> bet()
before input
enter a bet: ddd
after input
need a number between 0 and 49
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in bet
TypeError: '<' not supported between instances of 'str' and 'int'
指定编码。
例如encoding = "UTF-8"
。