A note on how the python or operator works:
For an expression x or y:
In the case that x is True, the expression returns x. This makes intuitive sense when x is a boolean--if x is True it returns True. In the case that x is False, then y is returned. This makes intuitive sense when y is a boolean. If x is False and y is True, you get a value of True from your or expression.
However, things get trickier when either x is not a boolean, or x is False and y is not a boolean. In your case, month == 1 is a boolean. As in the rules above, when this is false, it returns the second half of the or expression. Since 10 is not a boolean, but an integer, it is simply returned.
The reason month1 always equals 5 is that in your last two lines you have such a problem. In your statement
if month == 9 or 12:
python first checks to see what the or statement returns. Here, it will either return True (if the month actually is 9) or if month is not nine, since 12 isn't a boolean, it will return 12. Both of these values (True and `12) cause the if statement to pass, and the line after it to be evaluated, setting month1 to 12.s
I would note that the other answers explain better approaches to this code. However, it is still useful to understand how Boolean Operators work in python.