Basic Keywords
Basic Keywords
Basic Keywords
Keywords:
o Keywords are the reserved words in python.
Value Keywords:
True : The True keyword is used as the Boolean true value in Python code.
False : The false keyword is used as the Boolean false value in Python
code.
Operator Keywords:
and : The and keyword is used to determined if both the left and right
operands are truthy or falsy.
or : The or keyword is used to determine if at least one of the operands is
truthy.
not : The not keyword is used to get the opposite Boolean value of a
variable.
in : The in keyword will return True or False indicating whether the
element was found in the container.
Is : The is keyword determines whether two objects are exactly the same
object.
Basic Keywords
elif : The elif statement is only valid after an if statement or another elif.
else : The else statement denotes a block of code that should be executed
only if the other conditional blocks are false.
Basic Keywords
Iteration Keywords:
for : The for keyword is used to start a for loop. It is used to execute a set
of instruction/functions repeatedly when some condition becomes True.
while : The while keyword is used to start a while loop. This loop iterates a
part of the program several times.
Basic Keywords
continue : The continue keyword is used when you want to skip to the
next loop iteration.
else : The else keyword specifies code that should be run if the loop exits
normally.
Basic Keywords
Structure Keywords:
def : The def keyword is used to define a function or method of a class.
Returning Keywords:
return : The return keyword is used inside a function to exit it and return a
value.
Yield : The yield keyword is used inside a function like a return statement,
but yield returns a generator.
Basic Keywords
Import Keywords:
import : The import keyword is used to import modules into the current
namespace.