Lab 3.01 - Magic 8-Ball

1) Practice importing random, use randint with different arguments. Simulate a dice roll, printing out to the user what number they rolled.

2) Look at the documentation of the random library. Experiment with another function (not randint) that returns a value.

3) 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, and then return and print a random response.

Magic 8-ball response examples:

  • outlook is good
  • ask again later
  • yes
  • no
  • most likely no
  • most likely yes
  • maybe
  • outlook is not good

Bonus!

Research the math library and create a program that finds the length of a right triangle given two sides