Fewpal
0 votes
953 views
in Computer by (47.7k points)
closed by

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)

1 Answer

+1 vote
by (50.2k points)
selected by
 
Best 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)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...