[Python] for statement error

TypeError: 'int' object is not iterable What to do when the error occurs

How to use the for statement

Specify the range after in as shown below.

for i in range(0:4):
    print(i)
#0
 1
 2
 3

In the above example, 0 to 3 is specified after in.

How to use to get an error

If you enter only a number after in as shown below, an error will occur.

for i in 4:
    print(i)
#TypeError: 'int' object is not iterable

In the above example, since the number is entered after in, there is an error that you do not know how many times the for statement should be repeated.

Recommended Posts

[Python] for statement error
Python basics ② for statement
Python list, for statement, dictionary
[Python / PyQ] 4. list, for statement
Python Exercise for Beginners # 2 [for Statement / While Statement]
Python for statement ~ What is iterable ~
[Python] Multiplication table using for statement
2016-10-30 else for Python3> for:
Python if statement
python [for myself]
Python Error Handling
Python exec statement
[Python] if statement
Python assert statement
Solution for pip install error [Python] [Mac]
About Python for loops
Python Not Implemented Error
Today's python error: killed
About Python, for ~ (range)
python textbook for beginners
Refactoring tools for Python
Python error list (Japanese)
python for android Toolchain
[Introduction to Udemy Python3 + Application] 43. for else statement
Don't use readlines () in your Python for statement!
OpenCV for Python beginners
Python basic if statement
Install Python (for Windows)
Python environment for projects
Today's python error: HTTPError: 404 Client Error: Not Found for url:
A Java programmer studied Python. (for, if, while statement)
Python memo (for myself): Array
About Fabric's support for Python 3
Modern Python for intermediate users
Learning flow for Python beginners
Python 3.6 installation procedure [for Windows]
BigQuery integration for Python users
Python learning plan for AI learning
Set Up for Mac (Python)
Search for strings in Python
Python Tkinter notes (for myself)
OpenCV3 installation for Python3 @macOS
Python code memo for yourself
[Python] xmp tag for photos
[Python] SQLAlchemy error avoidance memorandum
Python environment construction For Mac
Techniques for sorting in Python
Addition with Python if statement
pp4 (python power for anything)
Python3 environment construction (for beginners)
Roadmap for publishing Python packages
Python 3 series installation for mac
Python #function 2 for super beginners
[youtube-dl] python3 SSL error (CERTIFICATE_VERIFY_FAILED)
Python template for Codeforces-manual test-
Error when playing with python
#python Python Japanese syntax error avoidance
Slice error in python (´ ; ω ; `)
Basic Python grammar for beginners
3 months note for starting Python
Qt for Python app self-update