68.7k views
5 votes
XII) Rewrite the following statements after correcting them:

a=300
b=120
if (a>b)
print(a)
else
print(b)
X2
x2 § 6

5 $ EE
Times​

User Stu Pegg
by
3.2k points

1 Answer

5 votes

Answer:

The correct code is as follows:

a = 300

b = 120

if (a > b):

print(a)

else:

print(b)

Step-by-step explanation:

The last 5 lines from the given code are not part of the program

There are 3 errors in the program and they are

(1) Indentation

The program lacks indentation from the beginning till the end

(2) if (a > b)

At the end of the if statement, the colon sign must be written before going to the next line.

The same applies to the else statement (the third error)

See answer section for corrections

User Yawl
by
3.9k points