I'm obtaining input values in a list using the following statement:
ar = map(int, raw_input().split())
However, I would want to limit the number of inputs a user can give at a time. For instance, if the limit is specified by a number n, the array should only capture the first n values entered during the program.
e.g: if n = 6, Input:
1 2 3 4 5 6 7 8 9 10
On performing 'print ar', it should display the following without any error messages:
[1, 2, 3, 4, 5, 6]