take indefinite inputs in python separated by newlines

74 views Asked by At

I want to take inputs separated by new lines, but i don't wan't it to take fixed amount of inputs. Then perform some action on given inputs. For more info look at this codechef problem.

1

There are 1 answers

0
Maleehak On

What you can do is to use while loop and check the value of input in each iteration

    input_list=[]
    value=input()
    while(value!=condition):
         value=input()
         input_list.append(value)