- This event has passed.
7 PM – Intro To Python – C
March 25, 2020 @ 7:00 pm - 8:00 pm
- We reviewed our String functions and List homeworks.
- We learned how get input from shell.
- We learned how to do simple IF-ELSE statements
- Homework:
- Create a program that would do the following
- Get input from user “How old are you? “. Save the input to a variable “age”.
- Get another input from user “Are you a genius (y/n)? “. Save the input to a variable “is_genius”.
- Create IF-ELSE statement just like we have learned in the class that will do the following,
- If age is greater 15 or is_genius is “y” then print “You can go to college”.
- else print “You can not go to college.”
- If you want to compare if “is_genius” is equal to “y” or “n”, do something like this
if is_genius == "y":
don’t do
if is_genius = "y":
- Examples
-
How old are you? 10 Are you a genius (y/n)? y You can go to college How old are you? 16 Are you a genius (y/n)? n You can go to college How old are you? 10 Are you a genius (y/n)? n You can not go to college
- Create a program that would do the following