Apr-15-2020, 12:54 AM
Hi
iam novice to python.I can't understand where i did the mistake & why. Kindly correct my code.
Thank you
iam novice to python.I can't understand where i did the mistake & why. Kindly correct my code.
#Write a Python program to add 5 seconds with the current time. import datetime t1 = datetime.datetime.now().time() print("Current time:", t1) t=t1+datetime.timedelta(seconds = 5) print("After 5 Seconds:", t)When i execute the above code iam getting "TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta'".
Thank you