Skip to content

Commit 7249ebb

Browse files
authored
Update RussianRoulette.py
Simplified and made interactive
1 parent 82498ab commit 7249ebb

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

RussianRoulette.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import random
22
import time
33

4-
bullet = random.randint(1,6)
5-
shot = random.randint(1,6)
6-
ready = True
4+
bullet = float(random.randint(1,6))
75

8-
if ready == True:
9-
print("The bullet is in slot...")
10-
print(bullet)
11-
time.sleep(2)
6+
while True:
7+
shot = float(input("Enter a number from 1-6"))
128
print("You are...")
139
time.sleep(1)
14-
if bullet == shot:
15-
print("Dead!")
16-
time.sleep(5)
17-
else:
18-
print("Alive!")
19-
time.sleep(5)
10+
if bullet == shot:
11+
print("Dead!")
12+
else:
13+
print("Alive!")
14+

0 commit comments

Comments
 (0)