15-112 Agenda 22-May
- Waitlist updates
- What you should be getting comfortable with
- Pzyo setup + can run code
- printing, syntax errors
- types: what they are and why we need them
- Python as a calculator
- order of operations
- syntax for math operations
- div + mod
- almostEqual
- calling, writing functions
- if else
- Comfort with Syntax –> practice practice practice!
- Looking forward
- today: Loops
- tomorrow: Strings (end of super mathy problems yay)
- hw3 out this afternoon
- type vs isinstance
- Questions from previous lecture or homework
- Conditionals
if-elif-else
def ct1(n): if n % 2 == 0: print("n is even") if n % 4 == 0: # change me to an elif print("n is a multiple of 4") print("hey there! I always run")
- Loops
- for loop syntax:
range(start,end, step) - nested for loops and
printStarRectangle - while syntax and
digitCount - converting a for loop into a while loop
- while loop vs for loop
- nthPrime
- break and continue
- for loop syntax:
- Attendance Check: https://tinyurl.com/summer112att2