You have some extra lines and if you want the dictionary output to be ordered by the way it was entered you need to use an OrderedDict
>>> from collections import OrderedDict as od
>>> def myfunc():
M=['January', 'February', 'March','April', 'May', 'June', 'July', 'August','September', 'October', 'November', 'December']
weather = od() #defining an ordered dictionary
for i in range(0, len(M)):
#theKeys = list(weather.items()) # you are not using this line
#theKeys.sort() # you are not using this one
inpt = int(input("How much did it snow in " + str(M[i]) + " ?:"))
weather[str(M[i])] = inpt
#theKeys = list(weather.items()) # this one is not used
print "total snow during the year was ", sum(weather.values())
print(weather)
the line sum(weather.values()) causes a list to be constructed with the values from the weather dictionary and then that list of values is summed
weather = od() initializes an OrderedDictionary with the name weather
>>> myfunc()
How much did it snow in January ?:1
How much did it snow in February ?:1
How much did it snow in March ?:1
How much did it snow in April ?:1
How much did it snow in May ?:1
How much did it snow in June ?:1
How much did it snow in July ?:1
How much did it snow in August ?:1
How much did it snow in September ?:1
How much did it snow in October ?:1
How much did it snow in November ?:1
How much did it snow in December ?:1
total snow during the year was 12
OrderedDict([('January', 1), ('February', 1), ('March', 1), ('April', 1), ('May', 1), ('June', 1), ('July', 1), ('August', 1), ('September', 1), ('October', 1), ('November', 1), ('December', 1)])