How can I accept multiple user inputs separated by a space? I don\'t know the number of inputs, but I do know they are all ints.
Here\'s some example inputs:
Try this:
nums = [int(i) for i in raw_input("Enter space separated inputs: ").split()]
s = raw_input("Please enter your numbers: ")
mynums = [int(i) for i in s.split()]
# OR
mynums = map(int, s.split())
for python 2.x
x,y = map(int,raw_input().split())
it take two variable x and y of int type separated by space and you can replace int with your desired type
for python 3.x
x,y = input().split()
it takes two variables x and y of string type separated by space and you have to convert explicitly
x,y=map(int,input().split())
#this will take input separated by space and map #into int