Home >>Python Keywords >Python as Keyword

Python as Keyword

Python as Keyword

Python as keyword is used to create an alias of the libraries etc.

In the example we create an alias "c" while importing the calendar module and now we can use the calendar module by using c instead of calendar.

Here is an example of Python as keyword:

import calendar as c
print(c.month_name[6])

Output:
June
Example 2:

import calendar as k
print(k.month_name[2])

Output:
February

Popular Tutorials