I'm really proud of myself. I'm sure that it isn't cool at all to anyone else - but this is 2 months of me studying Python every day for a hour.
What are some cool things I can add?
What about easier or alternative ways to do this?
import random
def Robbery():
total = 0
lootlist = []
lootposs = ["Watch", "Computer","Diamond"]
attempts = int(input("Pick a number of times"))
counter = 0
watch_total = 0
computer_total = 0
diamond_total = 0
game = "on"
sentence = random.randint(0,15)
print(f"----------------------------------------------------------------------")
print("\n----------START OF THE GAME----------\n")
for nums in range(attempts):
Outcome = random.randint(0, 10)
if Outcome in [0,1,2,3,4]:
stolen = random.randint(0,1000)
total = total + stolen
counter = counter + 1
print(f"----------------------------------------------------------------------")
print(f"\nNumber {counter} attempt was successful:")
print(f"-------------------------------------------")
print(f"You stole {stolen} dollars.")
print(f"You have stolen {total} dollars so far")
print(f"You have stolen {watch_total} watch, {computer_total} computer, and {diamond_total} diamond so far")
elif Outcome in [5,6,7]:
loot = random.choice(lootposs)
if loot == "Watch":
watch_total = watch_total + 1
elif loot == "Computer":
computer_total = computer_total + 1
else:
diamond_total = diamond_total + 1
lootlist.append(loot)
counter = counter + 1
print(f"----------------------------------------------------------------------")
print(f"\nNumber {counter} attempt was successful:")
print(f"-------------------------------------------")
print(f"You stole a {loot}!")
print(f"You have stolen {total} dollars so far!")
print(f"You have stolen {watch_total} watch, {computer_total} computer, and {diamond_total} diamond so far!")
else:
counter = counter + 1
game = "off"
print(f"\n----------------------------------------------------------------------")
print(f"\nNumber {counter} attempt YOU WERE CAUGHT :( \n")
print(f"You robbed {counter} times, stole {total} dollars!")
print(f"You took {watch_total} watch, {computer_total} computer, and {diamond_total} diamond!")
print(f"You went to prison for {sentence} years!")
break
if game == "on":
print(f"\n----------------------------------------------------------------------")
print(f"\nNumber {counter} attempt YOU WERE NEVER CAUGHT!!!!! :) \n \n")
print(f"You robbed {counter} times, stole {total} dollars")
print(f"You took {watch_total} watch, {computer_total} computer, and {diamond_total} diamond")