I'm a newbie and I'm still stumped...

Dwight GoldWinde Dwight at GoldWinde.com
Mon Aug 3 08:57:05 CEST 2015


Thank you, Emile, Paul, Terry, and Joel for your suggestions! And the
error persists.

Maybe my error is coming from running the old version (2.7.6) of Python,
but I can’t figure out why that would be happening???

I downloaded 3.4.3 again from the Python.org website for my Mac.
I inserted the "import sys" and did “print (sys.version)” into the code.

So here what the code is:

#!/usr/bin/env python3
import sys
print (sys.version)
word = input('Enter a word ')


Here are the results I got below, showing the same error. The first line
says, 
"2.7.6 (default, Sep 9 2014, 15:04:36)”. Does that mean I am running the
old Python? How could that be since I am SURE I downloaded 3.4.3 (it even
gives the folder name as “Python 3.4” in the Applications folder on my Mac.

2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
Enter a word serendipity
Traceback (most recent call last):
  File "test short.py", line 4, in <module>
    word = input('Enter a word ')
  File "<string>", line 1, in <module>
NameError: name 'serendipity' is not defined




Please help…

BIG SMILE...

Always, Dwight


www.3forliving.key.to (video playlist on YouTube)
www.couragebooks.key.to (all my books on Amazon)






#!/usr/bin/env python3
import sys
print (sys.version)
word = input('Enter a word ')


2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
Enter a word serendipity
Traceback (most recent call last):
  File "test short.py", line 3, in <module>
    word = input('Enter a word ')
  File "<string>", line 1, in <module>
NameError: name 'serendipity' is not defined





On 8/2/15, 12:30 AM, "Emile van Sebille" <emile at fenx.com> wrote:

>On 7/30/2015 6:22 PM, Dwight GoldWinde wrote:
>> I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner
>>2 as
>> my editor.
>>
>> Here¹s the code:
>> #!/usr/bin/env python3
>> word = (input('Enter a word Œ))
>>
>> When running this inside of Coderunner, I get the follow error, after
>> entering the word Œserendipity¹:
>>
>> Enter a word serendipity
>> Traceback (most recent call last):
>>    File "test short.py", line 2, in <module>
>>      word = (input('Enter a word '))
>>    File "<string>", line 1, in <module>
>> NameError: name 'serendipity' is not defined
>
>I'd look at which python is actually running (sys.version):
>
>Python 3.4.0 (default, Apr 11 2014, 13:05:11)
>[GCC 4.8.2] on linux
>Type "help", "copyright", "credits" or "license" for more information.
> >>> word = (input('enter a word '))
>enter a word test
> >>>
>emile at emile-OptiPlex-9010:~$ python
>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.
> >>> word = (input('enter a word '))
>enter a word test
>Traceback (most recent call last):
>
>
>Emile
>   File "<stdin>", line 1, in <module>
>   File "<string>", line 1, in <module>
>NameError: name 'test' is not defined
> >>>
>
>
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list