大佬们 帮小弟一下
import mathpos =
while True:
s = input()
if not s:
break
movement1 = s.split(" ")
direction = movement(0)
steps = int(movement(1))
if direction == 'up':
pos+=steps
elif direction == 'down':
pos-=steps
elif direction == 'left':
pos-=steps
elif direction == 'right':
pos+=steps
else:
pass
print(int(round(math.sqrt(pos**2+pos**2))))
运行错误,提示如下:
direction = movement1(0)
TypeError: 'list' object is not callable
什么意思?
是中括号,不是小括号
小括号是函数调用
页:
[1]