Data Types Flashcards
(16 cards)
x = “apple”
str
x = 1
int
x = 7.5
float
x = True
bool
x = [“apple”, “banana”]
list
x = {“name”: “Bob”}
dict
x = (“apple”, “banana”)
tuple
x = {“apple”, “banana”}
set
what is a str
words surrounded by “” or ‘’
what is a int
a number with no decimals
what is a float
a number with decimals
what is a bool
True or False
what is a list
an ordered collection of data that can be changed and indexed and allows duplicates
what is a dict
an ordered collection of data that can be changed and doesn’t allow duplicates. can only be indexed with the key from the key:value pair
what is a tuple
an ordered collection of data that cannot be changed but can be indexed and allows duplicates
what is a set
an unordered collection of data that can be changed that is unindexed and doesn’t allow duplicates