1/29
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
IN
Used to CHECK if a value is WITHIN another value.
LISTS
Data structure used for storing all data TYPES; int, float, string, etc. Created using [] square brackets.
APPEND
Adds value to the end of the list.
INSERT
Insert value at a location.
POP
Remove and return the value at the location.
LEN
Returns the TOTAL number of items within a string or list, short for length.
LIST
Converts item to a list.
TUPLES
Just like lists but UNADJUSTABLE.
DICTIONARIES
A hash table, map used for binding keys to values.
KEY
dictionary[key] - GET and SET the value.
DEL
del dict[key] - DELETE a value/key pair.
PYTHON DICTIONARY
Built-in data types in python, mapping object 'maps' value of one object with another.
Union of two dictionary objects
Returning new object.
CONDITIONAL STATEMENTS
Responsible in checking whether the given condition is true/false.
Basic Conditional Statement
if statement.
PYTHON CONDITIONS
Python supports the usual logical conditions from mathematics.
TAB
Python is supersensitive to spacing.
If Statement
Checks if a condition is true.
INDENTATION
Python relies on indentation (whitespace at the beginning of a line) to define scope in the code.
Elif Keyword
The elif keyword is Python's way of saying 'if the previous conditions were not true, then try this condition'.
Else Keyword
Is used when a condition is not satisfied.
Short-hand if-else
A one-liner conditional statement.
Ternary Operators
The use of multiple else statements on the same line.
Nested If Statement
If statements inside if statements.
Nested Else Statement
If statements inside else statements.
Pass Statement
If statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error.
LOGICAL OPERATORS
Operators that combine conditional statements.
And
The and keyword is a logical operator, and is used to combine conditional statements.
Or
The or keyword is a logical operator, and is used to combine conditional statements.
Not
The not keyword is a logical operator, and is used to reverse the result of the conditional statements.