I want to write a program that asks the user for number of years and then the temperature for each month for as many number of years as they have decided in the input like this:
Which is the first year?: 2015
Month 1: 25
Month 2: 35
.
.
.
for 12 months and I have written a code that works for that:
This is the outer loop for years:
loops = int(input("How many years?: "))
count = 1
while count < loops:
for i in range (0,loops):
input("Which is the " + str(count) + ": year?: ")
count += 1
This is the inner loop for months:
monthnumber = 1
for i in range(0,12):
input("Month " + str(monthnumber) + ": ")
monthnumber += 1
My question is, where do I place the inner loop for months so that the code continues like this:
Which is the 1 year? (input e.g. 2015)
Month 1: (e.g. 25)
Month 2: (e.g. 35)
..... for all twelve months and then continue like this
Which is the 2 year? (e.g. 2016)
Month 1:
Month 2:
I have tried putting it in different places but without success.