how to store values in two separate lists if given in same line in python

18 Views Asked by At

are there any ways to take inputs of all the values in single line but store some of the values in one list and some in other. eg. l1 and l2 are two lists and 6 integer values (for say 1,2,3,4,5,6) store first 3 elements in l1 and rest in l2

in python if you want to take inputs and store it in variables if they are entered in single line and separated by single space there surely is map and split function like

x,y = map(int,input().split(' '))

now i also know we can take inputs and store them in single list as well like this

num = list(map(int,input().split(' ')))

there is no way i can take inputs if i do

l1,l2 = list(map(int,input().split(' ')))

0

There are 0 best solutions below