« All Events
6 PM – Intro to Python – Gamas
June 8, 2023 @ 6:00 pm - 7:00 pm
Today We Did
- We reviewed page 84: 5-5
- We learned how to get an input from shell
Homework
- Create June8_InputFromShellHomework.py
- Do number 3 from https://www.ayclogic.com/list-inputs-if-and-else-loops-and-function/ . Make sure to use input from shell.
- Create a program that will do the following.
- You need to use if elif else and input from shell for this program.
- You need to ask user 2 things using Input from shell.
- What is your name
- What is your favorite color.
- You need to use if elif else to print the following
- if favorite color is green, then print “green is my favorite color too.”
- if favorite color is grey, then print “I do not like grey color.”
- if favorite color is everything else, then print “<person’s name> favorite color is <whatever color they enter>”
- If you do the code correctly below are some examples on how your program should work under different name and color inputs.
- Example 1
What is your name: Joe
Hi Joe, welcome to AYC Logic.
What is your favorite color: green
green is my favorite color too.
- Example 2
What is your name: Kade
Hi Kade, welcome to AYC Logic.
What is your favorite color: yellow
Kade's favorite color is yellow.
- Example 3
What is your name: Gamas
Hi Gamas, welcome to AYC Logic.
What is your favorite color: grey
I do not like grey color.
- Example 4
What is your name: Leila
Hi Leila, welcome to AYC Logic
What is your favorite color: red
Leila's favorite color is red