Better Months

In [2]:
def main():
    months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
    
    n = eval(input("Enter a month number (1-12):"))
    
    month_abbrev = months[n-1]
    print("The month abreviation is " + month_abbrev + ".")
In [3]:
main()
Enter a month number (1-12):7
The month abreviation is Jul.
In [ ]: