Receiving NameError on input in SublimeREPL

74 Views Asked by At

I'm trying these lines in Python 3 using SublimeText:

a = input('Geben Sie bitte das Wort "Hallo" ein: ')
if a == "Hallo":
    print('Korrekt!')

Now if I run that in SublimeREPL I get

Geben Sie bitte das Wort "Hallo" ein: Hallo
Traceback (most recent call last):
  File "S79.py", line 1, in <module>
    a = input('Geben Sie bitte das Wort "Hallo" ein: ')
  File "<string>", line 1, in <module>
NameError: name 'Hallo' is not defined

***Repl Closed***

However, it works if I run it online.

I don't quite get it. In SublimeREPL it only works if I type

'Hallo'

instead of

Hallo

Any suggestions?

========== Update: So I did further dig into this problem, and I am starting to think that SublimeText uses Python 3 YET SublimeREPL runs my code in Python 2. For instance, raw_input produces an error in the same script if I build it but makes it work in SublimeREPL instead. Further evidence for that problem to exist I found here. Is that even possible and how can I change that?

0

There are 0 best solutions below