0
Q:

'int' object is not iterable

#The error is that here, you need to use i to iterate through a list, but you specified an integer, namely len(sequence), instead of the necessary list ...

for i in len(sequence):

#To iterate through all integers from 0 up to, but not including len(sequence), you can specify the needed list, as follows ...

for i in range(len(sequence)):
4
int_variable = x
for element in range(int_variable):
  #Code of the for loop
1

New to Communities?

Join the community