为了账号安全,请及时绑定邮箱和手机立即绑定

以下情况,是不是需要引入一个函数啊 ?

以下情况,是不是需要引入一个函数啊 ?

慕容3067478 2022-08-04 23:19:22
from random import choicecave_numbers=range (0,20)unvisited_caves=range(0,20)visited_caves=[]caves = setup_caves(cave_numbers)visit_cave(0)print_caves()link_caves()print_caves()finish_caves()wumpus_location=choice(cave_numbers)player_location=choice(cave_numbers)while player_location==wumpus_location:player_location=choice(cave_numbers)while True:print_location=(player_location)new_location=get_next_location()if new_location is not None:player_location=new_locationif player_location==wumpus_location:print 'hahahahahhahha'break
查看完整描述

1 回答

?
www说

TA贡献1775条经验 获得超8个赞

你确定是setuo_caves而不是 setup_caves is not defined????如果是后者你在setup_caves函数前边加上choice.也就是写成choice.setup_caves如果是前者的话我找不出你说的错误!

查看完整回答
反对 回复 2022-08-08
  • 1 回答
  • 0 关注
  • 144 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信