61a lecture 11
play

61A Lecture 11 Friday, September 21 Midterm 1 Recap 2 Midterm 1 - PowerPoint PPT Presentation

61A Lecture 11 Friday, September 21 Midterm 1 Recap 2 Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 2 Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students


  1. 61A Lecture 11 Friday, September 21

  2. Midterm 1 Recap 2

  3. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 2

  4. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A 2

  5. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should 2

  6. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should 1 X vs WX 2

  7. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should 1 X vs WX 2

  8. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should twelve twenty-two 1 X vs WX 2

  9. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should twelve twenty-two 1 X vs WX if first_tens(p)==1: return second_tens(p)!=1 2

  10. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should twelve twenty-two 1 X vs WX if first_tens(p)==1: return second_tens(p)!=1 2

  11. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should twelve twenty-two 1 X vs WX if first_tens(p)==1: return second_tens(p)!=1 2

  12. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should twelve twenty-two 1 X vs WX X0 vs Y0 if first_tens(p)==1: return second_tens(p)!=1 2

  13. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should zero twenty twelve twenty-two 1 X vs WX X0 vs Y0 if first_tens(p)==1: return second_tens(p)!=1 2

  14. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should zero twenty twelve twenty-two twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: return second_tens(p)!=1 2

  15. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should zero twenty twelve twenty-two twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 2

  16. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 2

  17. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two ✓ twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 2

  18. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two ✓ twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 twenty-two twelve WX vs 1 X 2

  19. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two ✓ twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 else: return second_tens(p)==1 twenty-two twelve WX vs 1 X 2

  20. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two ✓ twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 else: return second_tens(p)==1 twenty-two twelve “You may not use boolean operator or ” WX vs 1 X 2

  21. Midterm 1 Recap The exam was more difficult than the Fall 2011 Midterm 1 Typically, more than 75% of students receive A’s & B’s in 61A Problem 4(c): through doesn’t rhyme with cough , and 20 ( twenty) doesn’t rhyme with 10 ( ten) Sight rhyme : A pair of words that don’t rhyme, but look like they should ✓ zero twenty twelve twenty-two ✓ twenty zero 1 X vs WX X0 vs Y0 if first_tens(p)==1: if first_tens(p)==0: return second_tens(p)!=0 return second_tens(p)!=1 else: return second_tens(p)==0 else: return second_tens(p)==1 twenty-two twelve “You may not use boolean operator or ” WX vs 1 X Demo 2

  22. Mapping a Function over a Sequence Apply a function to each element of the sequence 3

  23. Mapping a Function over a Sequence Apply a function to each element of the sequence >>> alternates = (-1, 2, -3, 4, -5) 3

  24. Mapping a Function over a Sequence Apply a function to each element of the sequence >>> alternates = (-1, 2, -3, 4, -5) >>> tuple(map(abs, alternates)) 3

  25. Mapping a Function over a Sequence Apply a function to each element of the sequence >>> alternates = (-1, 2, -3, 4, -5) >>> tuple(map(abs, alternates)) (1, 2, 3, 4, 5) 3

  26. Mapping a Function over a Sequence Apply a function to each element of the sequence >>> alternates = (-1, 2, -3, 4, -5) >>> tuple(map(abs, alternates)) (1, 2, 3, 4, 5) The returned value of map is an iterable map object 3

  27. Mapping a Function over a Sequence Apply a function to each element of the sequence >>> alternates = (-1, 2, -3, 4, -5) >>> tuple(map(abs, alternates)) (1, 2, 3, 4, 5) The returned value of map is an iterable map object A constructor for the built-in map type 3

Recommend


More recommend