Home >>Python Keywords >Python from Keyword

Python from Keyword

Python from Keyword

Python from Keyword in python is case-sensitive and is used to import only a specified section from a module, classes, functions, etc.

Here is an example of Python from Keyword:

from datetime import time
z = time(hour=12)
print(z)

Output:
12:00:00
Example 2:

from datetime import time
y = time(hour=10)
print(y)

Output:
10:00:00

No Sidebar ads