Unit Two (it's not wraps...yet) Flashcards
Command to switch a number to an integer?
int()
What is a “float”
a number that has a decimal (can be .0)
What is the float command in Python? What do you type in do get the float command in python?
float()
What are strings and what is the command for strings?
They are sequences of character data. the command is str()
What are two ways to have a quote inside a quotation?
Either using:
Double quotes: “ “” “
or
A backslash: “John/’s meal”
What does the backslash do in Python?
- can break up lines
- negates anything after it in a string
How is tab expressed in Python?
\t
What does \t do in python
tab
What is a raw string and how is it denoted?
a raw string disregards any escape sequences (ei “") that may come after it
it is formatted as such: print(r’john//’)
john//
What do triple-quoted strings do?
They can be used interchangeably with the backslash
What is boolean ?
True and False
absolute value function
abs()
What command is used to convert to a boolean value?
bool()
What function checks the type of a value?
type()
What function checks the length of a function?
len()
What function creates a list?
list()
What function sends a message to the user and receives a message?
input()
What does the != function mean?
not equal to
What needs to go in the square brackets?
print( {[ ]”Hello {name}’)
f
if
n = 300
and
m = n
does m = 300?
no because the identity codes will be different
can the first letter of a variable be a number ?
ex: 32goober
no
what are the three types of cases for variables and what do they mean?
camel case - has capitalized words not first word though (camel - capitalized)
pascal case - has the first letter capitalized
snake case - words are separated by underscores