1.

Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. Value=30 for VAL in range(0,Value) If val%4==0: print (VAL*4) Elseif val%5==0: print (VAL+3) else print(VAL+10)

Answer»

CORRECTED CODE: 

Value = 30 

for VAL in range(0,Value) :            # Error 1 

if val%4==0:                     # Error 2 

    print (VAL*4) 

elif val%5==0:                 # Error 3 

    print (VAL+3) 

else:                             # Error 4 

    print(VAL+10)



Discussion

No Comment Found

Related InterviewSolutions