Python 1 2 Flashcards
What does one row represent in a tabular dataset?
a single item/observation in your collection
What does one column represent in a tabular dataset?
a single piece of information
What shape does tabular data take?
a rectangle
What’s the difference between = and == in Python?
= assigns a value to a variable, == tests whether two items are the same
How do you write a multi-line string in Python?
””” wrap it in three quotes “””
How do you write a comment in Python?
#
What are the rules for Python variable names?
can use any upper/lowercase character, number, or _
What is the function to check what Python type something is?
type
How would you make a string with ‘my qb is Tom Brady’ using f strings if ‘Tom Brady’ was in a variable called name?
f’my qb is {name}’
(Python) What type of a variable is (1 == 2)?
bool
(Python) What is the value of (1 == 2)?
FALSE
(Python) What is the difference between variables and strings in terms of quotation marks?
strings always have quotation marks; variables never do
(Python) How would you refer to the first element in a list named my_list?
my_list[0]
(Python) How would you refer to the last element in a list named my_list?
my_list[-1]
(Python) How would you refer to the first two elements in a list named my_list?
my_list[0:2]