Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Errors that you will get in the Time class in Python DateTime

# Python program to demonstrate time class
# import the date class
from datetime import time

# will rase an ValueError as it is out of range
my_time = time(hour = 26)
print("my_time)

# will raise TypeError as string is passed instead of int
my_time = time(hour ='23')
print("my_time)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Errors #Time #class #Python #DateTime
ADD COMMENT
Topic
Name
8+6 =