American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

3PM Python Level 1

January 26, 2019 @ 3:00 pm - 4:00 pm

  1. We review variables and their data types.
  2. We go over “Making Decisions” chapter learning about conditions, conditional operators (<, >, == and !=).
  3. We learn about IF, IF ELSE and IF ELIF statements.
  4. Homeworks:
    1. Create a program (making_decisions_jan_26.py) that will do the following:
      1. Ask user “Give me your age? “
      2. If the user enters 0 print “You are a newborn baby”.
      3. If the user enters any number smaller than 4 then print “You are a toddler”.
      4. If the user enters any number smaller than 13 then print “You are a kid”.
      5. If the user enters any number smaller than 20 then print “You are a teenager”.
      6. If the user enters any number smaller than 40 then print “You are an adult”.
      7. If the user enters any number greater than 40 then print “Dude!! You are old.”.
    2. When you take input from the shell, this input is typed String. You cannot compare String with a number. You first have to convert the input into a number by using int(<variable>). This is important to do your homework. For example,
      1. number = input('Enter a number')
        if int(number) < 5:
           print('That is a small number.')

Details

Date:
January 26, 2019
Time:
3:00 pm - 4:00 pm
Event Categories:
,