12.3k views
18 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 Manuel R
by
6.0k points

1 Answer

8 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 Patie
by
5.7k points