Some functions in Python take a long list of arguments, and in most cases, it’s convenient to have default values for those arguments. For example, the default value for the end parameter of the print() function is \n - a new line. But if someone wants to print another symbol in the end, they can provide it with end='*', for instance. We can define default arguments in our functions as well:

In this example, we have to provide the number of hours to the work() function, but we can skip the from_home parameter. If we don’t provide it, it will be set to True as we have defined the function as def work(hours, from_home=True).

Challenge

Fill in the function to produce the correct result. The function should compute the distance between two points and . In some cases, the second coordinate is omitted, and therefore, the distance should be computed from the origin of the coordinate system - .

The function should accept 4 arguments and return the distance between those.

As a reminder, the distance between two points can be calculated with: