Because you need to increase it in the loop:
month = 11
months =[]
for i in range(5):
months.append(month + i)
More Related Contents:
- Why am getting an "elif" syntax error showing invalid syntax in python [closed]
- Source Code is the output in Python [closed]
- What are some Alternatives to enumerate function in Python?
- Accessing class variables from a list comprehension in the class definition
- Python 3: UnboundLocalError: local variable referenced before assignment [duplicate]
- Should I put #! (shebang) in Python scripts, and what form should it take?
- Priority of the logical operators NOT, AND, OR in Python
- Python iterator is empty after performing some action on it
- List attributes of an object [duplicate]
- Image library for Python 3
- Unable to set default python version to python3 in ubuntu
- How to uninstall a package installed with pip install –user
- Why np.hypot and np.subtract.outer very fast compared to vanilla broadcast ? Using Numba for speedup numpy in parallel for distance matrix calculation
- How to display an image after a time interval?
- What does *tuple and **dict mean in Python? [duplicate]
- How to change UI in same window using PyQt5?
- Creating an Ordered Counter
- Why do parentheses in a lambda function cause syntax error on Python 3? [duplicate]
- list comprehension filtering – “the set() trap”
- Sort a list of tuples depending on two elements [duplicate]
- Read .csv file from URL into Python 3.x – _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
- How to find cube root using Python? [duplicate]
- When using cx_Freeze and tkinter I get: “DLL load failed: The specified module could not be found.” (Python 3.5.3)
- How do you change the value of one attribute by changing the value of another? (dependent attributes)
- Changing the directory where .pyc files are created
- json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190) [duplicate]
- In Python, when are two objects the same?
- Handle JSON Decode Error when nothing returned
- ‘is’ operator behaves unexpectedly with floats
- Right-to-Left and Left-to-Right printed nicely