3. Reserved Words¶
There are reserved words in Python.
These words cannot be used to declare a variable or function.
In the conversion exercise, the words
float
,input
, andprint
are reserved words.
This program allows you to see a complete list of all reserved words in Python. Execute the program to see them.
3
import keyword
print(keyword.kwlist)
Activity: 3.1 ActiveCode (ac_l40_3_en)
Functions like
float()
,input()
, andint()
are not included here, but they are also words that meet the restriction.We can see directives like
if
,else
, andelif
, which we have used before.
You have attempted 1 of 2 activities on this page