You seem to be writing Python 3 code, but have probably selected Python as the language. Make sure you select “Python 3” in the language dropdown menu in your statusbar. You can change the default association for Python files under Preferences > File Associations.
You don’t understand properly what Nathan said. Change the language here:
(the bottom of Komodo).
If you want to associate your *.py files with Python 3 by default, go to Preferences - File Associations, find the *.py item and change the language to Python 3. Be sure to check Show Advanced checkbox to see File Associations item in the preferences list.
I think this should be prevented by Komodo, like if you try to set the Python 2.7 interpreter for Python 3, Komodo should throw a warning/error that it’s not something you should do and reset the interpreter to the default one (Find on Path option). What do you think about that?