The type query only works with proper syntax. Here two examples with bad syntax:

1
2
3
4
5
6
7
8
9
>>> type(1,True,2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type() argument 1 must be string, not int
>>> type("hello)
  File "<stdin>", line 1
    type("hello)
               ^
SyntaxError: EOL while scanning string literal

In the first case, type(1,True,2) failed because Python expected a single thing between the parentheses, not three things. (Notice that the error message reported by Python is not very helpful!) In the second case, the syntax error is an improperly formed string, with no doublequote to terminate the string. With these syntax bugs repaired, the example runs like so:

1
2
3
4
5
>>> type((1,True,2))
<type 'tuple'>
>>> type("hello")
<type 'str'>
>>>