commands and what they do Flashcards
int
integers; they are whole numbers | Ex: 14, 7, 241
float
floating point #s: they are numbers with a decimal point | Ex: 2.8, 7.6, 100.8
str
strings; these are an ordered sequence of characters or numbers within quotes | Ex: “hola”, “yellow”, “example”
list
lists; an ordered, changeable sequence of objects | Ex: [“hola”,7,2.8]
dict
dictionaries; unordered Key:Value pairs | Ex: {“key”:”value”,”name”:”Jose”}
tup
tuples; ordered unchangeable sequence of objects | (7.6,”yellow”,241)
set
sets; unordered collections of unique objects | {2.5,”example”,(2,3,5)}
bool
booleans; logical value that indicates True or False
\n
Puts the following string on a new line when printed
\t
Inserts a tab
len()
Returns the length of the string entered in the parentheses
str.upper()
Outputs everything in the string as uppercase
str.lower()
Outputs everything in the string as lowercase letters
str.split()
Outputs the string in a list as specified by the splitting condition typed into the parentheses | by default it splits by any white spaces in the string
%s
Inputs a specified string into the spot the function was placed: will convert whatever is specified into a string