|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import math
pos = [0,0]
while True:
s = input()
if not s:
break
movement1 = s.split(" ")
direction = movement(0)
steps = int(movement(1))
if direction == 'up':
pos[0]+=steps
elif direction == 'down':
pos[0]-=steps
elif direction == 'left':
pos[1]-=steps
elif direction == 'right':
pos[1]+=steps
else:
pass
print(int(round(math.sqrt(pos[1]**2+pos[0]**2))))
运行错误,提示如下:
direction = movement1(0)
TypeError: 'list' object is not callable
什么意思?
|
|