Operator: //
floor division operator; rounds result down to the nearest whole number (even if decimal is over 5 DONT round up)
Operator: %
modulo operator: finds the remainder of a division
Operator: !=
not equal to operator
Character: /n
newline character; moves to the beginning of the next line before printing the next characters
Character: \
backslash; can break long lines of code into multiple lines without breaking logical line of code, also used as a way to ignore the next character (when using quotations in the print statement)
PEMDAS
parentheses, exponent, multiplication, division, addition, subtraction (MD and AS have same level of priority; in the same equation go left to right)
split()
prints a string into a list of substrings. default is to split by whitespace, but you can change the delimiter to split by commas, hyphens, etc. output = [‘word’, ‘word’, ‘word’]
isalnum()
checks if all the characters in the string are alphanumeric, meaning either letters or numbers
returns True if all characters are and is not empty
returns False if there are spaces, punctuation, symbols, or if it is empty
isalpha()
checks if all characters are alphabetic(letters)
only allows letters
isdigit()
checks if all characters are digits (0-9); no spaces, punctuation, etc
index()
used to find the lowest index (position) of a substring within a string. It returns the index where the substring is first found. If the substring is not found, it raises a ValueError. if there is something after the comma (“o” , 5) it starts from index 5 to find the first occurence
count()
Returns the number of times a specified substring occurs in the string. Optional start and end arguments can limit the search range
strip()
Returns a string where leading and trailing whitespace is removed. You can optionally specify characters to remove instead of whitespace.
.lower()
string method that returns a copy of the string with all uppercase characters converted to lowercase.
It does not change the original string (because strings are immutable).
.upper()
returns a copy of the string with all lowercase characters converted to uppercase.
find()
Searches for the specified substring and returns the lowest index where it’s found. Returns -1 if the substring is not found. Optional start and end arguments can limit the search range.
.append()
adds a single item to the end of an existing list