I am using Python 3.6.5, and what I want is: when my variable go
is set to 1, my for i in range()
loop to stop running. However, when I put for i in range(go = 1)
, it outputs:
TypeError: range() does not take keyword arguments
UPDATE:
Here is my full range()
code:
for i in range(go = 1):
names.append(input(str(i)+": "))
UPDATE 2: Here was my code before:
for i in range(amount):
names.append(input(str(i)+": "))
In this, amount
is equal to whatever the user inputs, meaning however many names they want to fill.