Question & Answer

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

1 Answer

Verified archive
Quizzma TeamDecember 9, 2024

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!