Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to take unknown number of inputs in python

# PRESS ENTER WITHOUT WRITING TO STOP

inputs = []
while True:
    inp = input("Insert input: ")
    if inp == "":
        break
    inputs.append(inp)

print (inputs)
 
PREVIOUS NEXT
Tagged: #unknown #number #inputs #python
ADD COMMENT
Topic
Name
5+4 =