bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Python/Reference and Practice
Python•Reference and Practice

Python Keywords

Flash cards

Review the key moves

1/3
Core idea

What is the main idea behind Python Keywords?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers:

KeywordDescription
andA logical operator
asTo create an alias
assertFor debugging
asyncDefine an asynchronous function
awaitWait for and get a result from an awaitable
breakTo break out of a loop
casePattern in a match statement
classTo define a class
continueTo continue to the next iteration of a loop
defTo define a function
delTo delete an object
elifUsed in conditional statements, same as else if
elseUsed in conditional statements
exceptUsed with exceptions, what to do when an exception occurs
FalseBoolean value, result of comparison operations
finallyUsed with exceptions, a block of code that will be executed no matter if there is an exception or not
forTo create a for loop
fromTo import specific parts of a module
globalTo declare a global variable
ifTo make a conditional statement
importTo import a module
inTo check if a value is present in a list, tuple, etc.
isTo test if two variables are equal
lambdaTo create an anonymous function
matchStart a match statement (compare a value against cases)
NoneRepresents a null value
nonlocalTo declare a non-local variable
notA logical operator
orA logical operator
passA null statement, a statement that will do nothing
raiseTo raise an exception
returnTo exit a function and return a value
TrueBoolean value, result of comparison operations
tryTo make a try...except statement
whileTo create a while loop
withUsed to simplify exception handling
yieldTo return a list of values from a generator

Previous

Python File Methods

Next

Python Built-in Exceptions