Submit by Tuesday to get EC points (Today! July 5th)
Extensions can't be used for EC unless you have specific accommodations
HW2 due Thursday (July 7th)
Cats (Project 2!) begins Thursday
Checkpoint next Tuesday (July 12th)
Due following Tuesday (July 19th)
I'm out of town from Wednesday to Monday
People will cover labs and discussions; attendance will work the same way
Please still come - show them some love and make them feel welcomed
Instructor OH - conceptual help; super useful!
Result from last poll
Questions/Comments from last time
Starting is_prime's helper function from n - 1
defis_prime(n):defhelper(i):if i == 1:
returnTrueelif i < 1or n % i == 0: # i < 1 necessary for if you enter n = 1returnFalsereturn helper(i - 1)
return helper(n - 1)
Questions/Comments from last time
Study Groups - will be done on the attendance form (sorry I forgot about this last time )
There is something on Piazza to search for teammates FYI, but this is more for projects
Very similar to for loops, but can be done in 1 line!
[<expression> for <variable> in <sequence> [if <condition>]]
lst = [3, 2, 1]
[x * 2for x in lst if x < 3] # [4, 2]
[x * 2for x in [3, 2, 1]] # [6, 4, 2]
map, filter, reduce
Used to manipulate sequences
Makes copies of lists
map applies a function to each element in a sequence
filter chooses elements in a sequence based on a predicate
reduce combines elements together based on a function