In my case I have to get n inputs from user as they entered
Please enter size of an array:
If the user enters 3 or whatever he likes, then the program should take 3 inputs from the user in a single line like this
1 2 3
And if he enters a value greater than 3, the program should warn him about the input he has given.
Is there any way to do this?
Input:
Enter size of an array: 5
Output:
1 2 3 4 5
And the main thing is that it should not ask the user each time to enter 5 as an input and also it should also check that the user entered the correct number of inputs.
str.split,input(orraw_input),int(orfloat), at least onefor loopand some other stuff