meetspatel26042007
meetspatel26042007 meetspatel26042007
  • 22-04-2021
  • Computers and Technology
contestada

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​

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 27-04-2021

Answer:

The correct code is as follows:

a = 300

b = 120

if (a > b):

   print(a)

else:

   print(b)

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

Answer Link

Otras preguntas

Solve.[tex] \sqrt{x-1}+3=x [/tex]
Find th equation of the line below.If necessary, use a slash to indicate a division bar.. (2,14) (1,7)
If 10 men can complete a piece of work in 30 days how many men are requiredto complete the same job in 25 days?
Two batches of soup will serve 8 people. Lonnie needs to make enough soup for 120 people. If the recipe calls for 2 onions for one batch, how many onions will L
How does a television signal differ from a standard radio wave
Find th equation of the line below.If necessary, use a slash to indicate a division bar.. (2,14) (1,7)
In the pictures down belowCan anyone help? Fractions and percents
How does forest catch fire in the summer season
what is the domain, range, and function of y=absolute value of x-3 +2 i put the domain as 3 and the range as 2 and the function as yes
Solve.[tex] \sqrt{x-1}+3=x [/tex]