Skip to content

Commit ef50a32

Browse files
Completed Day 25: Sending it Back
1 parent 1635d5f commit ef50a32

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import random #randint()
2+
3+
def roll_dice(sides):
4+
return random.randint(1, sides)
5+
6+
def get_health():
7+
return roll_dice(6) * roll_dice(8)
8+
9+
print("⚔️ Character Stats Generator ⚔️\n")
10+
11+
while True:
12+
name = input("Name your warrior: ")
13+
print(f"Their health is: {get_health()}hp\n")
14+
15+
again = input("Roll for another character? ")
16+
print()
17+
18+
if again[0].strip().lower() == "y":
19+
continue
20+
else:
21+
break

0 commit comments

Comments
 (0)