Data Types Flashcards
What are Integers (int)
Whole numbers, positive or negative: 28 and -13
What are Floating Points (float)
Numbers that have a decimal point: 7.43 and -2.1. Also, uses exponential (e) to define the number. Example: 2e2, 3E2
What are Strings (str)
Ordered sequence of characters in quotations: “hello” ‘Sammy’ “2000”
- Immutable
What are Lists (list)
[ ]
Ordered sequence of objects: [10,”hello”,200.3]
- Mutable
- Can slice, index
What are Dictionaries (dict)
{ }
Unordered mappings for storing objects: Value Pairs: {‘key1’:’value’ , ‘key2’:’value2’}
- Cannot slice, index
- Can reassign values
What are Tuples (tup)
Similar to lists with one key difference: immutability (unchangeable) sequence of objects
- Tuples use parenthesis
- ex: (10,”hello”,200.3)
What are Sets (set)
Unordered collection of unique objects {“a”,”b”}
Booleans (bool)
Logical value indicating True or False