Python Python Collections (2016, retired 2019) Dungeon Game Movement

My quit doesn't work and I don't really understand why.

while True: print("Behold the dungeon!") print("You're in room{}".format(player)) print("You can move{}".format(", ".join(get_moves(player)))) print("Enter QUIT to quit")

move = input(">") move = move.upper

if move == 'QUIT': break if move in valid_moves: player = move_player(player, move) else: print("\n ** you ran into a wall!") continue

2 Answers

Shreyas Papinwar
Shreyas Papinwar
2,371 Points
move = input(">") 
move = move.upper

# Change this code to -
# and Note that when you call a method (such as upper), you need parentheses after it:

move = input("> ").upper() 

it will work fine

Stuart Wright
Stuart Wright
41,071 Points

Note that when you call a method (such as upper), you need parentheses after it:

move = move.upper()