I want to input in inline
1. input number : 5
2. 1 5 3 4 2
how to receive input for the number of inputs in python?
I've been tried like this:
num=int(input("inputs_num"))
mlist=[]
for i in range(num):
n=int(input())
mlist.append(n)
print(mlist)
I want to input in inline
I want to input in lnline- what exactly does that mean??1 5 3 4 2as input at once rather than one at a time, get rid of the loop, take the input as a string, and thensplitandmaptoint. You will end up with a list of ints.