GoConqr has a new look! Let us know what you think.

Mind map

Second Assignment

Colleen Faherty English

Map content

Second Assignment

  1. Lists [...,...,...]

    • Lists are ordered, so you can play with the indices and access list items with square brackets ex. myList[2]
    • changeable
    • allow duplicates
    • They can have elements with different data types
    • When you add data to a list its always placed at the end
    • to delete an element we can remove or pop ex. myList.remove("Lemon")
  2. Tuples (...,...,...)

    • used to store multiple items in a single variable
    • ordered
      • we can play with the indices and call on items ex. myTuple[2]
        • myTuple[-1] call on the last item
          • myTuple[1:3] will return a subtuple of the 2nd, 3rd and 4th elements
    • unchangeable
    • allow duplicates
    • allow multiple data types
  3. Sets {...,...,...}

    • unordered
      • so for loops are helpful to see items
        • or try true or false to see if an element exists in the set
    • unchangeable
    • reject duplicates
    • allow multiple data types
    • add elements by using .add ex. mySet.add("orange")
      • we can also merge sets by using .update ex. if newSet is an additional set, mySet.update(newSet)
  4. Dictionaries {key1:value1,...keyn:valuen}

    • used to store data in key:value format
    • VERY powerful to describe items
      • to me dictionaries seem the most useful data structure as far as "real world application goes"
    • the most different out of these four data structures
      • values in a dictionary can be of any data type

Information

Description
Mind Map on Second Assignment, created by Colleen Faherty on 03/02/2021.
Created by
Colleen Faherty
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?