Data Types Flashcards

1
Q

What are Integers (int)

A

Whole numbers, positive or negative: 28 and -13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are Floating Points (float)

A

Numbers that have a decimal point: 7.43 and -2.1. Also, uses exponential (e) to define the number. Example: 2e2, 3E2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are Strings (str)

A

Ordered sequence of characters in quotations: “hello” ‘Sammy’ “2000”
- Immutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Lists (list)

[ ]

A

Ordered sequence of objects: [10,”hello”,200.3]

  • Mutable
  • Can slice, index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Dictionaries (dict)

{ }

A

Unordered mappings for storing objects: Value Pairs: {‘key1’:’value’ , ‘key2’:’value2’}

  • Cannot slice, index
  • Can reassign values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Tuples (tup)

A

Similar to lists with one key difference: immutability (unchangeable) sequence of objects

  • Tuples use parenthesis
  • ex: (10,”hello”,200.3)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Sets (set)

A

Unordered collection of unique objects {“a”,”b”}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Booleans (bool)

A

Logical value indicating True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly