Use randint
with different arguments. Simulate a dice roll, printing out to the user what number they rolled.
Look at the documentation of the random
library.
Experiment with another function in the random
library (not randint
) that returns a value.
Create a program that simulates a Magic 8-Ball
- Store all of the 8-Ball's possible responses (shown below) in a list
- Have the program prompt the user to ask the Magic 8-Ball a question
- Then return and print a random response.
- Outlook is good
- Ask again later
- Yes
- No
- Most likely no
- Most likely yes
- Maybe
- Outlook is not good
Research the math
library in Python.
Create a program that finds the length of the hypotenuse of a right triangle, given the two perpendicular sides.
Can this program be completed without using import math
?