Answers for "how to take unknown number of inputs in python"

0

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)
Posted by: Guest on June-02-2021
0

how to take unknown number of inputs in python

from sys import stdin 
lines = stdin.read().splitlines()
print(lines)
Posted by: Guest on October-17-2021

Code answers related to "how to take unknown number of inputs in python"

Python Answers by Framework

Browse Popular Code Answers by Language