Loading Events

« All Events

  • This event has passed.

7 PM – Intro to Python – Joel

September 15 @ 7:00 pm - 8:00 pm
Today we did:
  1. We reviewed the 2nd quiz exercises.

 

Homework:
  1. Make a new file called Sep15_2ndQuizPrep.py, and do the following:
    1. Make a function called get_average_grade. It should have 3 parameters: grade1, grade2, and grade3. Use the formula for average (adding them all and dividing by 3) and return the result. Store the result in a variable and then print “The average grade is <grade>” to the shell.
    2. Make a list of 5 animals. Loop through this list. If one of the animals is “lion” or “tiger”, print <animal> is a dangerous animal. Otherwise just print each animal.
    3. Using this same list, take a random animal from the list and store it in a variable. Also, take a random integer from the range of 0-14 and store that as the animal’s age. Then, print “The <animal> is <animal’s age> years old”.
    4. Using a while loop, keep asking the user to input an animal. Add this animal to that list. Only stop asking if the user enters “quit”.
    5. Print “hello” 10 times using a for loop.
  2. Next week, the quiz will be 1-hour long, and open notes (you can only look at your previous files). The code will be written in Thonny, and you will copy and paste the codes to the Google Form questions.
  3. If you have any questions, feel free to email me at joel@ayclogic.com.

Details

  • Date: September 15
  • Time:
    7:00 pm - 8:00 pm