Double loop

Report a typo

What numbers will the following code print?

for x in range(1, 3):
    for y in range(-2, 0):
        print(x * y)

Enter the output numbers in the correct order, all on one line, separated by spaces.

Remember:

  1. The last number in a range is not included.

  2. Pay close attention to the order in which the nested loops are executed.

Enter a short text
___

Create a free account to access the full topic