Python Keywords and Their Descriptions, Summaries of Programming Languages

A comprehensive list of python keywords, along with their descriptions. Keywords are essential elements of the python programming language that perform various functions such as creating loops, defining functions, handling exceptions, and more. Understanding these keywords is crucial for mastering python programming.

Typology: Summaries

2019/2020

Uploaded on 09/24/2021

Ochandi12
Ochandi12 🇺🇬

8 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Python Keywords
Keyword Description
And A logical operator
As To create an alias
Assert For debugging
Break To break out of a loop
Class To define a class
Continue To continue to the next iteration of a loop
Def To define a function
Del To delete an object
Elif Used in conditional statements, same as else if
Else Used in conditional statements
Except Used with exceptions, what to do when an exception occurs
False Boolean value, result of comparison operations
Finally Used with exceptions, a block of code that will be executed no matter if there is an exception or
not
For To create a for loop
From To import specific parts of a module
Global To declare a global variable
If To make a conditional statement
Import To import a module
In To check if a value is present in a list, tuple, etc.
Is To test if two variables are equal
LambdaTo create an anonymous function
None Represents a null value
Nonlocal To declare a non-local variable
Not A logical operator
Or A logical operator
Pass A null statement, a statement that will do nothing
pf2

Partial preview of the text

Download Python Keywords and Their Descriptions and more Summaries Programming Languages in PDF only on Docsity!

Python Keywords Keyword Description And A logical operator As To create an alias Assert For debugging Break To break out of a loop Class To define a class Continue To continue to the next iteration of a loop Def To define a function Del To delete an object Elif Used in conditional statements, same as else if Else Used in conditional statements Except Used with exceptions, what to do when an exception occurs False Boolean value, result of comparison operations Finally Used with exceptions, a block of code that will be executed no matter if there is an exception or not For To create a for loop From To import specific parts of a module Global To declare a global variable If To make a conditional statement Import To import a module In To check if a value is present in a list, tuple, etc. Is To test if two variables are equal LambdaTo create an anonymous function None Represents a null value Nonlocal To declare a non-local variable Not A logical operator Or A logical operator Pass A null statement, a statement that will do nothing

Raise To raise an exception Return To exit a function and return a value True Boolean value, result of comparison operations Try To make a try…except statement While To create a while loop With Used to simplify exception handling Yield To end a function, returns a generator