in python, I want to code for the user to choose between a 4-sided dice, a 6-sided dice or a 12-sided dice. how do i do that?

Recommended Answers

All 4 Replies

Which version of Python?

And is input from the command line, or are you using a GUI toolkit to get input and show the dice.

the latest version and command line

Maybe something simple like ...

sides = int(input("Dice has how many sides, 4, 6, or 12? "))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.