Python Guide // Ep 7// Subroutines + return command

preview_player
Показать описание
Episode 7 of my python guide about libraries, more specifically, the time and os library. Also paramaters of subroutines and lastly the return command. I hope you enjoy!

Download link to Thonny:

Answer to challenge:

import random, os, time
def rollDice(side):
return result
def health():
healthStat = ((rollDice(6)*rollDice(12))/2)+10
return healthStat
def strength():
strengthStat = ((rollDice(6)*rollDice(8))/2)+12
return strengthStat
while True:
print("⚔ CHARACTER BUILDER ⚔")
print()
name = input("Name your Legend:\n")
type = input("Character Type (Human, Elf, Wizard, Orc):\n")
print()
print(name)
print("HEALTH:", health())
print("STRENGTH:", strength())
print()
print("May your name go down in Legend…")
print()
again = input("Again?:\n")
if again=="No" or again=="no":
break

Social Media:

TAGS:

Python, python for hackers, python for everyone, python for everybody, python right now, you need to learn python right now, learn python, python for beginners
Рекомендации по теме
Комментарии
Автор

i loved the task for this one, plz keep doing stuff like this 😊

starseventea
join shbcf.ru