小编use*_*353的帖子

TypeError:|:'int'和'str'的不支持的操作数类型

我试图通过一些已经存在的关于我的错误的问题,但他们都没有做到这一点.这是我尝试运行的代码:

from random import *

location1 = randint(0,7)
location2 = location1 + 1
location3 = location2 + 1
guess = None
hits = 0
guesses = 0
isSunk = False

while (isSunk == False):
   guess = raw_input("Ready, aim, fire! (enter a number from 0-6): ")
   if (guess < 0 | guess > 6):
      print "Please enter a valid cell number!"
   else:   
      guesses = guesses + 1;
   if (guess == location1 | guess == location2 | guess == location3):
      print "HIT!" …
Run Code Online (Sandbox Code Playgroud)

python typeerror python-2.7

2
推荐指数
1
解决办法
1730
查看次数

标签 统计

python ×1

python-2.7 ×1

typeerror ×1