Używanie funkcji input w python2.7 to ryzykowna sprawa. Python wówczas stara się rozpoznać typ wartości jaki ma zwrócić:
Equivalent to eval(raw_input(prompt)).
This function does not catch user errors. If the input is not syntactically valid, a SyntaxError will be raised. Other exceptions may be raised if there is an error during evaluation.
If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.
Consider using the raw_input() function for general input from users.
Źródło: https://docs.python.org/2/library/functions.html#input
Przykład:
Kopiuj
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = input()
2.7
>>> type(a)
<type 'float'>
>>> b = input()
2
>>> type(b)
<type 'int'>
>>> c = input()
2, 8, 9, 10
>>> type(c)
<type 'tuple'>
Na twoim miejscu użyłbym funkcji raw_input:
Kopiuj
line = raw_input()
tokens = line.split()
numbers = [int(token) for token in tokens]
q,w,e,r,t,y,u,i,o,p,a = numbers