##The computer will print a welcome message print("Welcome to the 'simulating a dice' program") print("Hope you enjoy!!!") ##Then it will explain briefly the purpose and the instructions of the game print("The purpose of the game is to choose a dice and see what is your score") print("The instructions are very simple, you just have to select a dice of either 4, 6, or 12 sides") ##The player will be able tu choose which dice is he going to roll. ##If the number is different to 4, 6, or 12 an error message will be shown, he will be able to start again. diceThrown = input("4, 6, or 12?") while diceThrown not 4, 6, 12 print("Your number is wrong, please try again") ##The computer will now print which dice has the user chosen and what score has he got input("Your dice was:" dice thrown) ##Now the computer will ask the user if he/she wants to
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