repl.it
@dcbriccetti/

Python adventure game fundamentals

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from random import randint

money = 100
inventory = []

if randint(1, 2) == 1:
  inventory.append('Soccer ball')
  print('A friend gave you a soccer ball')

print(', '.join(inventory))

# The following subtracts 50 from money
if randint(1, 2) == 1:
  print('You bought some golf balls')
  money -= 50

print(f'You have ${money}')
Fetching token
?