#Dictionary of rooms rooms = { ‘Garden’: {‘East’: ‘Craft Room’,…
Question Answered step-by-step #Dictionary of rooms rooms = { ‘Garden’: {‘East’: ‘Craft Room’,… #Dictionary of roomsrooms = { ‘Garden’: {‘East’: ‘Craft Room’, ‘South’: ‘Kitchen’}, ‘Craft Room’: {‘West’: ‘Garden’}, ‘Kitchen’: {‘West’: ‘Dining Room’, ‘South’: ‘Living Room’, ‘East’: ‘Office’, ‘North’: ‘Garden’}, ‘Dining Room’: {‘East’: ‘Kitchen’}, ‘Office’: {‘West’: ‘Kitchen’, ‘North’: ‘Bedroom’}, ‘Bedroom’: {‘South’: ‘Office’}, ‘Living Room’: {‘North’: ‘Kitchen’, ‘East’: ‘Piano Room’}, ‘Piano Room’: {‘West’: ‘Living Room’},}directions = [‘North’, ‘South’, ‘East’, ‘West’]current_room = rooms[‘Garden’]while True: #print direction commands print(‘Direction Commands are:’, directions) #How do i make current room print properly print() print(‘You are in {}.’.format(current_room)) command = input(‘nWhich Way? ‘).strip() if command in directions: if command in current_room: current_room = rooms[current_room[command]]My code for printing the current room isn’t functioning properly, it pulls the contents of ‘Garden’ instead of just printing ‘Garden’, Im not sure how to make it print the name correctly, while also accessing the dictionary in order to change rooms as the player moves? Computer Science Engineering & Technology Python Programming Q IT 140 Share QuestionEmailCopy link Comments (0)


