- This event has passed.
10 AM – Intro to Python – Darin (Riley Class)
August 10, 2023 @ 10:00 am - 12:00 pm
What We Did Today:
- Covered variables and data types, typecasting, combining strings
- Covered if and else statements along with and/or operators and ==, <, >, !=, <=, and >=
- Learned how to get input from shell
- Learned print formatting
Homework:
Get input from shell for 2 things, prompting the users:
- Name
- Age
Example: “Please enter your name: ”
Check if age is less than 2: check if name == bob, print “yes”, else print “no”
else if age is between 2 and 10 inclusive: check if name == henry, print “yes”, else print “no”
else if age is between 11 and 19 inclusive: check if name == riley, print “Hi Riley” (using variable)
else: print “goodbye”
NOTES:
- Make sure prompting for name is case insensitive, so you can put in RiLeY and get “Hi Riley” as your output. Keep in mind it’s Riley, not RiLeY.
- If you have any questions, email me at ddjapri@ayclogic.com.