function with default values for the arguments in python

def fan_speed(speed = 1 )-> str:
    if speed > 5:
        return "fan can't go with more speed "
    return "The speed of fan is " + str(speed)
print(fan_speed())#if you don't provide the speed of fan the fan will come 
#to its defalt value 1 and the speed of fan will become 1

Here is what the above code is Doing:
1. We have created a function named fan_speed() that takes an optional parameter speed.
2. The default value of speed is 1.
3. If the speed is greater than 5, the function returns a message saying that the fan can’t go with more speed.
4. Otherwise, it returns a message saying that the speed of the fan is equal to the value of the speed parameter.
5. We have called the function with different values of the speed parameter.
6. When we call the function without providing a value for the speed parameter, the function uses the default value of 1.