input spaces seperated integers in python

# case1: suppose you need to get two integers
i1, i2 = map(int, input().split())

# case2: want a list? 
lst = map(int, input().split())

Here is what the above code is Doing:
1. It’s taking input from the user.
2. It’s splitting the input on the basis of spaces.
3. It’s converting the input to integers.
4. It’s storing the integers in two variables i1 and i2.
5. It’s storing the integers in a list.