# Create a character that would be used in a video game that has the following in its code. # Use """ at the beginning and end of a description that describes the character. Use random numbers like the dice and craps codes to create random characteristics like for example strength. # Have at least six characteristics. Also add in the elif and while command like the combine elif and while code. print("These are the stats for you character") import random print("You wake up in Vault 2½. It is in ruins, you look around to see the vault has been abandoned for a while.") print("You find a 'S.P.E.C.I.A.L' book, you dust it off and skim through it")+ # Generate Strength die1 = random.randint(1, 5) die2 = random.randint(1, 5) strength = die1 + die2 print("Strength", strength) # Generate Perception die1 = random.randint(1, 5) die2 = random.randint(1, 5) Perception = die1 + die2 print("Perception", Perception) # Generate Endurance die1 = random.randint(1, 5) die2 = random.randint(1, 5) endurance = die1 + die2 print("Endurance", endurance) # Generate Charisma die1 = random.randint(1, 5) die2 = random.randint(1, 5) charisma = die1 + die2 print("Charisma", charisma) # Generate Intelligence die1 = random.randint(1, 5) die2 = random.randint(1, 5) intelligence = die1 + die2 print("Intelligence", intelligence) # Generate Agility die1 = random.randint(1, 5) die2 = random.randint(1, 5) agility = die1 + die2 print("Agility", agility) # Generate Luck die1 = random.randint(1, 5) die2 = random.randint(1, 5) luck = die1 + die2 print("Luck", luck) player= input('What is your name: ') print('Hello', player)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question