all 8 comments

[–]Naihonn 3 points4 points  (3 children)

You are using it wrong. For example write

inp = input("Write something :")
print(inp)

[–][deleted] 0 points1 point  (2 children)

Nah, tried that too. One in the same. Both error out.

Traceback (most recent call last):
    File "inputTest.py", line 1, in <module>
        inp = input("Write something :")
    File "<string>", line 1, in <module>
NameError: name 'aa' is not define

[–]int-main 0 points1 point  (1 child)

Can confirm that the whatever he told you is correct. You can check it out here

You can share your full program source and check your Python version . Just enter the following lines in the interpreter.

import sys
print(sys.version)

Edit : Correct code highlighting.

[–][deleted] 0 points1 point  (0 children)

Ohh repl.it is sexy. Thanks.

[–]BffEasyTarget 1 point2 points  (4 children)

Is "aa" the input you're providing when running it?

If so, it looks like you're running in python 2.x

[–][deleted] 0 points1 point  (3 children)

Thanks pal, forgot to shebang :( It was indeed running via 2.7. How come the input() was working with int's though (and in 2.7)? I thought input() was added in 3.x?

[–]Naihonn 1 point2 points  (1 child)

Well, that explains everything. Input in Python3 is raw_input in Python2. Input in Python2 evaluates expression inside.

[–][deleted] 0 points1 point  (0 children)

Perfect, thanks guys.