Data Type Flashcards
1
Q
Integers
A
- int
- Whole numbers, such as: 3 300 200
2
Q
Floating point
A
- float
- Numbers with a decimal pint: 2.3. 4.6. 100.0
3
Q
Strings
A
- str
- ordered sequence of characters: “hello” ‘Sammy’ “2000”
4
Q
Lists
A
- list
- Ordered sequence of objects: [10,”hello”,200.3]
- In brackets []
5
Q
Dictionaries
A
- dict
- In { }
- Unordered Key:Value pairs: {“mykey”:”value”,”name”:”Frankie”}
- thisdict = {“brand”: “Ford”, “model”: “Mustang”, “year”: 1964}
print(thisdict[“brand”])
6
Q
Tuples
A
- tup ( )
- thistuple = (“apple”, “banana”, “cherry”)
print(thistuple) - Ordered immutable sequence of objects: (10,”hello”,200.3)
7
Q
Sets
A
- Braces {}
- set
- myset = {“apple”, “banana”, “cherry”}
- Unordered collection of unique objects: {“a”,”b”}
- Note: Set items are unchangeable, but you can remove items and add new items.
8
Q
Booleans
A
- bool
- Logical value indicating True or False
9
Q
Text Type
A
str
10
Q
Numeric Types
A
- int
- float
- complex
11
Q
Sequence Types
A
- list
- tuple
- range
12
Q
Mapping Type
A
dict
13
Q
Set Types
A
- set
- frozenset
14
Q
Boolean Type
A
bool
15
Q
Binary Types
A
- bytes
- bytearray
- memoryview