American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

4PM Python Level 1

May 25, 2019 @ 4:00 pm - 5:00 pm

  1. We reviewed Animal Quiz homework from page 39 to 41.
  2. We reviewed “convert_year_to_second” function homework.
  3. We reviewed Loops: for loop and while loop and how to break from loop.
  4. Homeworks:
    1. Create a “for loop” to print the following 5 times:
      1. ‘Hello world!’
    2. Create a program to do the following:
      1. Ask user in the shell, “How many times you want me to print? “.
      2. Save user input to variable “num_of_print”.
      3. Use “num_of_print” variable to print “Hello World” repeatedly. Use “for loop” to print repeatedly.
      4. For example this is how the program will do
        1. How many times you want me to print? 3
          Hello World
          Hello World
          Hello World
      5. Another example:
        1. How many times you want me to print? 6
          Hello World
          Hello World
          Hello World
          Hello World
          Hello World
          Hello World
    3. Create a program that will do the following:
      1. Ask user “How old are you? ” and save the user input to a variable “age”.
      2. Ask user “Are you a genius? ” and save the user input to a variable “genius”.
      3. Create a while loop with the following condition
        1. IF age is not equal to “bye” AND genius is not equal to “bye”.
        2. Inside the while loop do the following
          1. IF age is bigger than 16 OR genius is equal to “y” OR genius is equal to “yes” then print “You can go to college.”
          2. ELSE print “You cannot go to college.”
        3. Repeat asking input from shell “How old are you? ” save to “age” variable. And also ask from sheel “Are you a genius? ” save to “genius” variable.
    4. Do only “Exercise 1” in https://www.ayclogic.com/coding-in-python-level-1/star-wars-problem/

Details

Date:
May 25, 2019
Time:
4:00 pm - 5:00 pm
Event Categories:
,