How can I make it so that the right number is always greater than or equal to the left number?
for i in range(5):
for j in range(5):
# Right (j) should be greater than or equal to left (i)
# i.e. j >= i should always be True
print(i, j)
I tried to use: if i > j: but I did not know how to continue it.
There are 2 basics errors:
the condition
i > jstands foristrict smaller thanj. To include equality use the relationi >= jleft, right and
i,jare swapped: left should bei, rightjThen use the condition in the innermost body of the loops
Remark: you could use also the dual relation
i <= j