- This event has passed.
3PM Python Level 1
January 26, 2019 @ 3:00 pm - 4:00 pm
- We review variables and their data types.
- We go over “Making Decisions” chapter learning about conditions, conditional operators (<, >, == and !=).
- We learn about IF, IF ELSE and IF ELIF statements.
- Homeworks:
- Create a program (making_decisions_jan_26.py) that will do the following:
- Ask user “Give me your age? “
- If the user enters 0 print “You are a newborn baby”.
- If the user enters any number smaller than 4 then print “You are a toddler”.
- If the user enters any number smaller than 13 then print “You are a kid”.
- If the user enters any number smaller than 20 then print “You are a teenager”.
- If the user enters any number smaller than 40 then print “You are an adult”.
- If the user enters any number greater than 40 then print “Dude!! You are old.”.
- 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,
-
number = input('Enter a number') if int(number) < 5: print('That is a small number.')
-
- Create a program (making_decisions_jan_26.py) that will do the following: