TypeError: 'int' object is not iterable What to do when the error occurs
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.
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