• 20 hours
  • Medium

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 3/6/20

Utilize collections and optionals

Log in or subscribe for free to enjoy all this course has to offer!

Evaluated skills

  • Utilize collections and optionals
  • Question 1

    To declare an empty array, one can write:

    Careful, there are several correct answers.
    • []

       

    • [Int]

       

    • [Int: String] ()

    • [Double]()

  • Question 2

    When is the order of elements important?

    • In an array because a key is used to retrieve the values

    • In an array because an index is used to retrieve the values

    • In a dictionary because a key is used to retrieve the values

    • In a dictionary because an index is used to retrieve the values

  • Question 3

    To browse/walk an array, we use:

    • a while loop

       

       

    • a for-in loop

       

    • an if/else statement

    • a dictionary