Question #351

What is the output of the code snippet below?
def verify(num1, num2):
    if num1 > num2:
        return num1
    elif num1 == num2:
        return 1
    else:
        return num2


def display(arg1, arg2):
    if verify(arg1, arg2) == arg1:
        print("A")
    elif verify(arg1, arg2) == 1:
        print("C")
    else:
        print("B")


display(1000, 3500)

Here, the execution start from the call of the display() function, that, in return, calls the verify() function. As 1000 is smaller then 3500 , verify() returns 3500 . In the display() function block, "B" will be returned. (tutorialspoint.com/python/python_functions.htm)


Comment on Disqus:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅