296,901 views
27 votes
27 votes
Give output for the following:

a. i=125

if i<124:

else:

print(i, 'is a greater number')

print(i, 'is a lesser number')​

User Ringmaster
by
2.6k points

1 Answer

23 votes
23 votes

Output: Syntax Error

(Since the if statement is empty, which is not allowed in python)

In case you mistyped the Question:

The condition i<124 is false,

so the code from the else part will get executed.

Output: '125 is a lesser number'

User PDA
by
3.1k points