MoonLab - TIL

This is where i store my today-i-learned

You may also wannna visit my blog

Home

Python Types

Collection Data Types

get length: len(dict)

List

list = [10, 20, 30]

Lists are used to store multiple items in a single variable.

  1. ordered
  2. changeable
  3. allow duplicate values

Tuple

Set

Dictionary

dict = {
    "a": "abc",
    "year": 1986
}
  1. not allow duplicate values - Dictionaries cannot have two items with the same key.
  2. changeable
  3. unordered in old version, ordered in new version