Error Related Questions
Error Related Questions
Observe the following Python codes very carefully and rewrite it after removing all syntactical errors
with each correction underlined.
fee=250 fee=250
0=i i=0 # i=0
while fee=<2000: while fee<=2000: # <=
if fee<=750: if fee<=750:
print(fee) print(fee)
fee=+250 fee=+250 # +=
else: else:
print(("fee*i) print(fee*i) # ( and “
i=i+1 i=i+1
fee=Fee+250 fee=fee+250 # fee
a={'6': "Amit", '2' : "Sunil" : '3' : "Naina"} a={'6': "Amit", '2' : "Sunil" ,'3' : "Naina"} # comma
for i in a: for i in a:
if(int(i)%3=0 if(int(i)%3==0: # == and colon
print(a(i)) print(a(i)) #indentation
30=max max=30
For N in range(0,max) for N in range(0,max) : # for and colon
IF n%3==0: if N%3==0: # if and capital N
print(N*3) print(N*3)
ELSE: else: #else
print(N+3) print(N+3)
Salary=4000, Salary=4000,
Bonus==8900 Bonus=8900 # single =
For I in range(0,6) For I in range(0,6) : # colon
If Bonus>=5000 If Bonus>=5000: #colon
Print(Salary+400) print(Salary+400) # small p of print
Else if Bonus<5000 elif Bonus<5000: # elif and colon
print(Salary+500) print(Salary+500)
else: else:
Print(“ no increment”) Print(“ no increment”)