Today I made a Slot machine
symbols = ["š", "š", "š", "š", "7", "š"]
This is the code for the Symbols
while True:
spin = random.choices(symbols, k=3)
print("\nSpinning...")
print(f"\n| {spin[0]} | {spin[1]} | {spin[2]} |")
This is the code for the spinning
if spin[0] == spin[1] == spin[2]:
print("\nš JACKPOT! All three match!")
elif spin[0] == spin[1] or spin[0] == spin[2] or spin[1] == spin[2]:
print("\n⨠Two symbols match! Not bad!")
else:
print("\nš No match. Try again!")
This is the code that sees if you won
choice = input("\nPlay again? (y/n): ").strip().lower()
if choice != 'y':
print("\nThanks for playing! š²")
break
This is the code that allows you to play again
