Computer Science

Find the errors in the code given below and correct the code:

if n == 0
   print ("zero") 
elif : n == 1     
   print ("one")  
elif             
   n == 2:        
   print ("two") 
else n == 3:      
   print ("three")

Python Control Flow

71 Likes

Answer

The corrected code is below:

if n == 0 : #1st Error
   print ("zero") 
elif n == 1 : #2nd Error
   print ("one")  
elif n == 2: #3rd Error  
   print ("two") 
elif n == 3: #4th Error     
   print ("three")

Answered By

36 Likes


Related Questions