import time
import random
print('Welcome to the slot machine app!')
credit = 100
print('You have 100 credits!')
print('Each turn would cost 25, 50 or 100 credits.')
credit0 = 1
while (1 == 1):
choice = int(input('1 for trying at the slots, 2 for checking the credits, 3
for exiting the game: '))
if (choice >= 4):
print('Add the correct value!')
if (choice ==1):
while (1 == 1):
print('1 for 25 at stake, 2 for 50 at stake, 3 for 100 at stake.')
slotchoice = int(input('Which slot would you like to try?(Press 4 to go
back to main menu): '))
if (slotchoice >= 5):
print('Add the correct value!')
if (slotchoice == 1):
if (credit0 == 6):
print('Sorry, we cannot add any more credits :(')
continue
if (credit <= 24):
print('Oh no! You are out of or do not have enough credits!
Here is another 25 to keep you going!')
credit = credit + 25
credit0 = credit0 + 1
continue
number = random.randint(1,3)
credit = credit - 25
if (number == 2 or number == 3):
print('Sorry, you lost. 25 credits lost.')
continue
if (number == 1):
print('Lucky, you won! 25 credits added!')
credit = credit + 25
continue
if (slotchoice == 2):
if (credit0 == 6):
print('Sorry, we cannot add any more credits :(')
continue
if (credit <= 49):
print('Oh no! You are out of or do not have enough credits!
Here is another 50 to keep you going!')
credit = credit + 50
credit0 = credit0 + 1
continue
number = random.randint(1,3)
credit = credit - 50
if (number == 2 or number == 3):
print('Sorry, you lost. 50 credits lost.')
continue
if (number == 1):
print('Lucky, you won! 50 credits added!')
credit = credit + 50
continue
if (slotchoice == 3):
if (credit0 == 6):
print('Sorry, we cannot add any more credits :(')
continue
if (credit <= 99):
print('Oh no! You are out of credits! Here is another 100 to
keep you going!')
credit = credit + 100
credit0 = credit0 + 1
continue
number = random.randint(1,3)
credit = credit - 100
if (number == 2 or number == 3):
print('Sorry, you lost. 100 credits lost.')
continue
if (number == 1):
print('Lucky, you won! 100 credits added!')
credit = credit + 100
continue
if (slotchoice == 4):
break
if (choice == 2):
time.sleep(2)
print(credit)
if (choice == 3):
print('Goodbye! See you next time!')
time.sleep(2)
break