Why do I get this error?
JordanDixon1 (306)

python
import time, os, random
#Functions for Betting Arena.

level_counter = 2.5

lvlbar = 0

lvlneed = 2

upgrades = []

level = 1

money = 57

job = 'McDonald\'s Employee'

daily_earnings = 9

def bet():
print('The horse races are about to begin! Pick your horse and the amount you would like to bet.')
print('Horses are as follows:')
print('1)The Speedy Lightning')
print('2)Hitmarker')
print('3)The Trashy Terror')
print('4)The Slippery Shadow.')
horse = input('Which horse are you gonna bet on: ')
if horse == '1':
print('You bet on The Speedy Lightning!')
elif horse == '2':
print('You bet on the Hitmarker!')
elif horse == '3':
print('You bet on... The Trashy Terror..?')
elif horse == '4':
print('You bet on The Slippery Shadow!')

time.sleep(2.5)
os.system('cls')
winning = random.randint(1,4)
running = True
while running == True:
	print('What would you like to bet?')
	print('Your money: ' + str(money))
	bet = input('Your bet: ')
	try:
		bet = int(bet)
		money =- bet
		running = False
	except:
		print('Thats not a valid amount.')

print('You bet: $' + str(bet))
print('And we\'re off to the races...')
time.sleep(4)
os.system('cls')
if winning == 1:
	print('YOU WON!!!')
	money = bet * 4
	print('Your money: ' + str(money))
else:
	print('Sorry sport. You lost... There was a 1 in 4 chance of winning.')
	

def joob():
if job == 'McDonald\'s Employee':
print('Flip the burgers!')
print('1)Flip \n2)Help')
user = input('Choice: ')

	if user == '1':
		
		burger = 0
		
		burgerneeded = random.randint(1, 10)
		
		while burger << burgerneeded:
			os.system('cls')
			time.sleep(6)
			print('Flip!!!!')
			input('Press enter to flip.')
			os.system('clear')
			time.sleep(6)
			print('Flip!!!!')
			input('Press enter to flip.')
			os.system('clear')
			burger+=1
			counter = 10 - burger
			print('Great job! Only ' + str(counter) + ' burgers to go!')
			time.sleep(1.5)
			os.system('cls')
		
		money =+ daily_earnings
		print('Great Job! You got paid: ' + '$' + str(daily_earnings))
		
		impressedboss = False
		
		if impressedboss == False:
			print('You impressed your boss and got a raise!')
			daily_earnings =+ 2
			impressedboss = True
		
		
		lvlbar = lvlbar + level_counter
		
		if lvlbar == lvlneed:
			print('You Leveled Up!')
			lvlneed + 4
			lvlbar = 0
			level_counter = level_counter + 2

I keep on getting local variable defined in enclosing scope.

You are viewing a single comment. View All
Answered by PizzaRules668 (8) [earned 5 cycles]
View Answer