Quizzma Latest Questions

What is printed by the following program?

What is printed by the following program?
def print_numbers(two, one, zero):
print(two)
print(one)
print(zero)

zero = 0
one = 1
two = 2
print_numbers(zero, one, two)

0
1
2
0
1
2
zero
one
two
two
one
zero




Leave an answer

Leave an answer

What is the capital of Egypt? ( Cairo )

1 Answer

  1. The output of the program will be:

    
    

    0

    1

    2

    ### Explanation:
    1. The function `print_numbers` takes three arguments: `two`, `one`, and `zero`.
    2. When the function is called with `print_numbers(zero, one, two)`, the values passed are `zero = 0`, `one = 1`, and `two = 2`.
    3. Inside the function, it prints the values in the order they’re received, which results in printing `0`, `1`, and `2`.

    So the final printed output will be:

    “`

    0

    1

    2

    If you have more questions or need further assistance, feel free to ask!

Related Questions