Today, we learned
- Data types, variables, operators (+, -, *, /, %)
- % is modulo, the remainder operator
- Increment with += (there are also -=, *=, /=, %=)
- String concatenation with +
- Printing formatted strings with f-string
- print(f”You can print {variable} like this.”)
- Variable name rules (can’t start with a number, can’t have space, can have a-z, A-Z, _, and 0-9)
- String formatting with .upper(), .lower(), .title(), .strip(), .lstrip(), .rstrip()
- Escape sequences (\n, \t, \”)
- Conditionals with if, elif, else (most specific case on top)
- == for equal, != for not equal
- and, or, not
Homework
- Try out code examples from pages 20-23 of the textbook (Textbook Link), and save it to a file called Jun_24_StringHomework.py.
- Do #3 from List, Inputs, IF and ELSE, Loops and function, and save it to a file called Jun_24_IfElseHomework.py.
If you have any questions, feel free to email me at isaac@ayclogic.com!