if 10 > 5: print("10 less than 5") print("Program ended") | Sololearn: Learn to code for FREE!

0

if 10 > 5: print("10 less than 5") print("Program ended")

The output is 10 less than 5 Program ended How is this possible as 10 is greater than 5

3/16/2020 5:18:12 AM

Purushotham D

3 Answers

New Answer

+4

Purushotham D as you know x + 1 always will be greater than x where x is positive so don't think that whatever written in print function inside that condition will print. Here "10 less than 5" is just to confuse people. But you should believe that 10 is always greater than 5. So don't be confused. We can print anything it doesn't mean that 10 will not be greater than 5. if 10 > 5: print("10 == 5") print("10 <= 5") print("10 >= 5")

+1

Because 10 is more then 5, as you wrote 10>5