American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

7 PM – Intro to Python – Joshua Widjanarko (Joel-sub)

November 21, 2024 @ 7:00 pm - 8:00 pm

Homework:
  1. Make sure to review the following topics:
    1. Variable
    2. If-Elif-Else, Input
    3. List (accessing from a list, adding to the list, getting the length of the list)
    4. For loops (For loop for a list, for loop using range())
    5. While loops
  2. The exercises below are optional if you want to practice for the quiz.
  3. Create a new file called Nov21_1stQuizReview and do the following exercises:
    1. #1
    2. Make a variable called first_name and set it to your name.
    3. Make a variable called favorite_number and set it to your favorite number.
    4. Make a variable called likes_pizza and set to True or False depending on whether you like pizza or not.
    5. print the following statement: <first_name> loves the number <favorite_number> and it’s <likes_pizza> that they like pizza.
    6. #2
    7. Ask the user: “What is the current temperature?”
    8. If the temperature is less than 0, print “It’s freezing outside!”
    9. If the temperature is between 0 and 20, print “It’s quite chilly, wear a jacket. “
    10. If it is greater than 20, print “It’s warm outside, enjoy the sunshine!”
    11. #3
    12. Make a new list called hobbies with at least 3 of your hobbies.
    13. Access and print the second hobby in the list.
    14. Add a new hobby to the list using .append()
    15. Print the total amount of hobbies using len()
    16. #4
    17. Create a list ‘fruits’ that has 5 fruits. Loop through the list and for each fruit, print “<fruit> is delicious!”
    18. #5
    19. Using a for loop, print “Hello” 10 times.
    20. #6
    21. Make a program that keeps asking the user: “Enter a positive number (or 0 to quit)”
    22. If the user enters negative number, print “Negative numbers are not allowed!” and continue asking.
    23. If the user enters 0, print “Goodbye!” and stop the loop
    24. Otherwise, print “You entered: <number>”

Details

Date:
November 21, 2024
Time:
7:00 pm - 8:00 pm
Verified by MonsterInsights