Computer Science, asked by vikrantpalle7996, 5 months ago

Value =30
ifval%4==0:
Print(val*4) Else if val%5==0:
Print (val+3) Correct this program
.

Answers

Answered by BestStudentSince2004
0

Mistakes:

  • The 'P' in 'Print' should be lowercase
  • There should be a space after 'if' and 'val' in line 2
  • For this to work, the variable in line 1 should be 'val' no 'Value', else it throws NotDefined error
  • There should be indent (space/tab) before the 'Print' in 3th line, then new line without indent after '...al*4)'
  • 4th line should be indented

How it should be:

val = 30

if val%4 == 0:

print(val*4)  

else if val%5==0:

print (val+3)

(hope it helps newbie)

Similar questions