« All Events
7PM Python Level1
October 26, 2018 @ 7:00 pm - 8:00 pm
- We went over Python Quiz 1 questions and result
- Homework:
- We are going to write a program which is very similar to the scratch “Ask Gobo” from the white scratch book page 60 to 65. We call this game “Magic 8 Ball”. This is a continuation from last week homework. Name this file Magic8Ball.py
- Create a function that would do the following
- Ask the user the following “Ask Yes or No Question”
- Wait for the user to enter something. After user enter something print “You ask, <whatever user ask>”.
- And then the function will pick a random number from 1 to 8.
- Use the logic from last week homework to decide what answer to give (print) to the user.
- After providing the answer, ask the user again with “Ask Yes or No Question” in a forever loop.
- Only quit the loop if user type “quit”
- Create a separate python file called “NameMyBaby.py”
- Create a list of String variable (“boysName”) with the following value: ‘John’, ‘Peter’, ‘Marcus’, ‘James’, ‘Luke’.
- Create a list of String variable (“girlsName”) with the following value: ‘Abigail’, ‘Martha’, ‘Mary’, ‘Katherine’, ‘Agustine’.
- Create a function
- this function would ask a user, ‘What is your baby gender? (boy/girl)’
- If user answer boy, it would pick a random name from ‘girlsName’ list and print the name.
- If user answer girl, it would pick a random name from ‘boysName’ list and print the name.
- After providing the name, keep asking the user until user type ‘quit’.