I'm working on a script in Python but I have a problem: The for loop is supposed to run code in the loop until it reaches the variable 'leng'. Because for loops stop at right before the stop value is reached, I need the stop value to be 1 more than leng. I have a script that looks something like this:
leng = input()
for i in range(1, (leng + 1)):
but I always get the error message in the shell:
t_Creator_v1.py", line 9, in <module>
for i in range (1, (leng + 1)):
TypeError: Can't convert 'int' object to str implicitly
I tried searching stackoverflow but I couldn't find any results that suit me. How would I get what result I want? Please respond, thanks.