Overview
- Multiplication of a timedelta instance by an integer or a floating point number is supported through the * operator.
Example
# Example Python program that multiplies
# timdelta instances by integer and floating point
# values
from datetime import timedelta
halfLapTime = timedelta(minutes = 3)
# One full lap is two half laps
oneLapTime = halfLapTime * 2
print("Time required to complete one lap:")
print(oneLapTime)
print("Time required to complete two and half laps:")
print(oneLapTime*2.5)Output
Time required to complete one lap:
0:06:00
Time required to complete two and half laps:
0:15:00