Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
31 Cards in this Set
- Front
- Back
- 3rd side (hint)
and |
Logical AND operator. Requires all parts of expression to be true for the expression to be true. ie: if x is false, then x, else y |
Boolean Operator |
|
or |
Logic OR operator. If any part of expression is True, then the expression is True. ie: if x is false, then y, else x |
Boolean Operator |
|
del |
Removes: Items from lists, slices from lists, entire variables from local or global namespace |
Simple Statement |
|
assert |
Inserts debugging assertions that return an error when false. |
Simple Statement |
|
pass |
Pass is a null operation, when executed nothing happens.
Useful when statement is required syntactically, but not code needs to be executed. |
Simple Statement |
|
|
Evaluates each expression in turn and writes the resulting object to standard output. |
Simple Statement |
|
return |
This statement is the evaluation of an expression that results in a return value which can be utilized by your program |
Simple Statement |
|
yield |
This statement is used like return but returns a generator |
Simple Statement |
|
raise |
Used for raising an exception (a signal that an error or other unusual condition has occurred) |
Simple Statement |
|
break |
Used in for and while loops. Terminates the nearest enclosing loop. |
Simple Statement |
|
continue |
Used in for and while loops. Rejects all remaining statements in current iteration of loop and moves the control back to the top of the loop. Skipping an iteration in the loop. |
Simple Statement |
|
import |
1. Finds module an initializes if necessary. 2. Defines a name or names in local namespace |
Simple Statement |
|
global |
used to declare that a function or method intends to change the value of a name from the global scope, that is, a name from outside the function |
Simple Statement |
|
from |
used when importing a module it declares that it is pulling from a specific module. |
Augments Import Statement |
|
not |
declares that a given statement is false. ie: if x is false, then True, else False. |
Boolean Operator |
|
while |
creates a loop that continues so long as a specific condition is true. |
Compound Statement |
|
as |
used with "with" and "Import" to assign a custom variable name and removes the original name. |
clause |
|
elif |
Short for 'else if'. Used to test multiple conditions in a given statement. |
Compound Statement |
|
with |
used to wrap the execution of a block with methods defined by a context manager. Intended to allow safe acquisition and release of os resources |
|
|
class |
a statement that creates a new class definition. The name of the class immediately follows the keyword class followed by a colon |
Simple Statment |
|
else |
this clause is executed when the a loop terminates through exhaustion of the list (with for) or when the condition becomes false (with while). |
Compound Statement |
|
if |
used to test IF a condition is true or false using boolean values |
Compound Statement |
|
except |
Specifies one or more exception handlers. |
Error Handling |
|
exec |
compiles and immediately evaluates a statement or set of statement contained in a string |
Simple Statement |
|
in |
verifies membership of a value in a string. |
Keyword |
|
finally |
as part of a try statement it specifies a 'cleanup' handler |
Compound Statement |
|
is |
compares object identity, determines if two variables are the same. vs == which compares two values. |
Keyword |
|
def |
is used to define a function, which allows you to create re-usable code. |
Keyword |
|
for |
creates a loop with any object that has an iterable method (ie lists, tuples etc) and strings. |
Compound Statement |
|
lambda |
Shorthand to create anonymous functions |
Expression |
|
try |
used in handling errors, tests a specific condition and if it passes will run the rest of the code, if it fails it raises an exception |
Exception Handling |