YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Len Quiz - Intro to Computer Science

Get Embed Code
6 Languages

Showing Revision 6 created 05/25/2016 by Udacity Robot.

  1. [Narrator] Now we're ready for our first quiz about append, plus, and len.
  2. The question is to answer what is the value of len of P--
  3. --the length of P after running the following code?
  4. These are the 3 statements:
  5. the first one creates a list 1, 2 and assigns that to the variable P.
  6. Then we use append, passing in 3 as the value to append,
  7. invoking append on the variable P, and then we have an assignment
  8. that assigns the P the result of P + the list 4, 5.
  9. The question is after running those 3 statements,
  10. what is the value of len of P?