def money():
cashin = input("Please insert money: £1 Per Play!")
dif = 1 - cashin
if cashin < 1.0:
print ("You have inserted £", cashin, " you must insert another £", math.fabs(dif))
elif cashin > 1.0:
print ("Please take your change: £", math.fabs(dif))
else:
print ("You have inserted £1")
menu()
def menu():
print ("Please choose an ARTIST: <enter character ID>")
print ("<BEA> - The Beatles")
print ("<MIC> - Michael Jackson")
print ("<BOB> - Bob Marley")
cid = input()
if cid.upper == ("BEA"):
correct = input("You have selected the Beatles, is this correct? [Y/N]:")
if correct.upper() == ("Y"):
bea1()
else:
menu()
elif cid.upper() == ("MIC"):
correct = input("You have selected Michael Jackson, is this correct? [Y/N]:")
if correct.upper() == ("Y"):
mic1()
else:
menu()
elif cid.upper() == ("BOB"):
correct = input("You have selected Bob Marley, is this correct? [Y/N]:")
if correct.upper() == ("Y"):
bob1()
else:
menu()
else:
print ("That is an invalid character ID")
menu()
this is part of my code for a jukebox
my code is giving me the error that bea is not defined if I type 'bea' on the 'CHOOSE AN ARTIST' input. but i'm not trying to use it as a function or a variable? I want to use an if statement to decide what to do based on the users input
usually this works for me, I don't know what the problem is. This is only a section of my code, if you need to see more let me know