Question: Where is the syntax error in this code? def myMonth ( xMonth ) : months = [ ' Jan ' , 'Feb','March','April','May','June','July','Aug','Sep','Oct','Nov','Dec' ] if 1

Where is the syntax error in this code?
def myMonth(xMonth):
months =['Jan','Feb','March','April','May','June','July','Aug','Sep','Oct','Nov','Dec']
if 1<= xMonth <=12:
sPrint = 'The month is '+ months[xMonth-1]
sMonth = months[xMonth-1]
else:
sPrint = 'Value is out of the range'
return (sPrint)
nMonth = int(input("What is the current month? "))
print(myMonth(nMonth))
a.
Line 3
b.
Line 6
c.
Line 1
d.
No syntax error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!