Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Format for elif
#5
Line 32 has an error, the variable name
    if eggs_delivered == True and room[name] == 'Entrance way':
instead of string 'name'
    if eggs_delivered == True and room['name'] == 'Entrance way':
Also in the function below
def msg(room):
  print(room)
  if room[msg]==' ':
    return "you have entered the " + room['name']+' '
  else:
    return room['msg']
if room[msg]==' ': is trying to use the function itself as a key i think you meant to have if room['msg']==' ':
Reply


Messages In This Thread
Format for elif - by sunilramakumar - Apr-08-2019, 01:49 AM
RE: Format for elif - by Larz60+ - Apr-08-2019, 03:00 AM
RE: Format for elif - by sunilramakumar - Apr-08-2019, 10:38 AM
RE: Format for elif - by Larz60+ - Apr-08-2019, 05:10 PM
RE: Format for elif - by Yoriz - Apr-08-2019, 05:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Whats the right way to refactor this Big if/elif/elif ? pitosalas 1 2,290 Jul-28-2019, 05:52 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020