« All Events
5 PM – Indo – Intro To Python – Joel
October 27, 2023 @ 5:00 pm - 6:00 pm
Today we did:
- We learned:
- Variables and data types (Strings, Integers, Floats, Booleans)
- How to print
- Addition, subtraction, multiplication, Division
- Adding strings using +, and using f-strings (For example, f”Hi, my name is {name}”)
- If-elif-else chains
- And & or operators
Homework:
- Create a new file called Oct27_StringHomework.py
- From pages 20-23, copy the Python code from the book.
- If you don’t have the book yet, you can look at this PDF file – IntroToPythonP20toP23
- Create a new file called Oct27_IfElseHomework.
- Inside the file, create two variables: age and price
- Set price to 10 initially, and set age to 12.
- Then, using if-elif-else chains, check a couple of things:
- If age < 4, set the price to 0
- Else, if age < 18, set the price to 25
- Else, if age < 65, set the price to 40
- Else, set the price to 20
- At the end, display: Your admission cost is $, and then the price. For example, if the price is 40, then it should like: Your admission cost is $40.
- Make sure to submit the homework in the Google drive before Friday.
- If you have any questions, feel free to email me at joel@ayclogic.com or Mr. Gamas at gamas@ayclogic.com