Answer to Question #261980 in Python for Gopi

Question #261980

Write a program in python to print respective month of a year.

1
Expert's answer
2021-11-06T11:48:35-0400

print("Enter the month number between 1 to 12 : ")

#this code asks you to choose the number of a current month

month = int(input())

#this is assigning input where you can enter the number of a month

if month<=12 :

  if month==1 : 

    print("January")

  elif month==2 :

    print("February")

  elif month==3 :

    print("March")

  elif month==4 :

    print("April")

  elif month==5 :

    print("May")

  elif month==6 :

    print("June")

  elif month==7 :

    print("July")

  elif month==8 :

    print("August")

  elif month==9 :

    print("September")

  elif month==10 :

    print("Octomber")

  elif month==11 :

    print("November")

  elif month==12 :

    print("December") 

else :

  print("No Such Kind Of Month Exists Please Input Between 1 to 12 ")

 #here are conditions to find and to show which month


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS