Programmers learn & share
0 votes
42 views

Problem :

I am facing below python list problem
design a program that lets the user enter the total rainfall for each of 12 months into an array
by (6.9k points)   | 42 views

1 Answer

0 votes

Solution :

In Python you can not use dictionaries so you can make a separate list for the month names as shown in below example:

months = ["jan", "feb", "mar", ... ]

Then you can use the index of the returned value in any given method to get the month name from the other list,as shown in below example:

def lowest():
    low = min(year)
    month = months[year.index(low)]
   
by (36.1k points)  
2,204 questions
2,606 answers
59 comments
241 users