Skip to main content

Command Palette

Search for a command to run...

DAY 25 100Days of Python

Published
•1 min read•View as Markdown
I

I am Junior Data Scientist, using python for my analysis and modelling. I have few projects i have worked on and I'm loving this process. I'm open to working with anyone willing to help me through this process.

#DAY 25 100Days of python
import random

def rollDice(sides):
  result = random.randint(1,sides)
  return result

def roll_6_and_8():
  roll_6_sided_dice = rollDice(6)
  roll_8_sided_dice = rollDice(8)
  health = roll_6_sided_dice * roll_8_sided_dice
  return health

print("⚔️Character stats generator⚔️")


haveACharacter = "yes"

while haveACharacter == "yes":
  character = input("Name your warrior: ")
  health = str(roll_6_and_8())
  print("Their health is ", health,"hp" ) 
  haveACharacter = input("Want to create another character?")