class Monthes:
def init(self,month):
self.month = month.lower()
def numb_month(self):
month = self.month
num_month = ''
if month == 'December':
num_month = '12; Season: Winter'
elif month == 'January':
num_month = '1; Season: Winter'
elif month == 'February':
num_month = '2; Season: Winter'
elif month == 'March':
num_month = '3 Season: Spring'
elif month == 'April ':
num_month = '4 Season: Spring'
elif month == 'May ':
num_month = '5 Season: Spring'
elif month == 'June':
num_month = '6 Season: Summer'
elif month == 'July':
num_month = '7 Season: Summer'
elif month == 'August':
num_month = '8 Season: Summer'
elif month == 'September':
num_month = '9 Season: Autumn'
elif month == 'October':
num_month = '10 Season: Autumn'
elif month == 'November':
num_month ='11; Season: Autumn'
return num_month
n = input("import month: ")
p =Monthes(n)
print(p.numb_month())
I want to convert numbers between 1-12 to months, like this For example
input: 3
outuput: March, Spring
well something like that. Thank u I've tried some other things but it didn't work either, this code works but halfly