« All Events
5pm Intro To Python – Bill
September 29, 2021 @ 5:00 pm - 6:00 pm
Today We:
- Learned about the Random Module
- Learned about how to pick random numbers from a range
- Learned how to pick a random item out of a list
- Learned how to pick a random letter out of a string
Your HW:
- Create a new file “Magic8BallProjectV1”
- Get the input from shell “Ask any Question Here: “
- Pick a random number from 1 – 5 and save that random number to a variable Result_Number
- Make a chain of if, and elif statements to check what number Result_Number is
- Depending on what that Result_Number is, print out a random answer
- if Result_Number is 1, print out yes,
if Result_Number is 2, print out no,
if Result_Number is 3, print out maybe,
if Result_Number is 4, print out its possible,
if Result_Number is 5, print out never
- if you need help or more clarification, look at your old Ask Gobo project
it is essentially the same idea