How do I accept individual multiple user input from space? I do not know the number of inputs, but I know that they are all inserts.
Here are some example inputs:
13213 412 8143 12 312 1321 142 9421 9 29 319 I know that if I already know the number of inputs, but I'm having trouble making this normal. I will only ask the user how many group inputs of intets:
inputs = int (raw_input ("Enter the number of raw input")) for num = [] xrange for i (1, Input): num.append (raw_input (Enter '% s number:')) But I am looking for a more beautiful solution that the user does not need to ask 2 questions
s = raw_input ("Please enter your number:") mynums = [I ( I) for s.split ()] # or mynums = map (int, s.split ())
Comments
Post a Comment