[Tutor] Simple python help

Jordan wolfrage8765 at gmail.com
Mon Jun 23 14:59:12 CEST 2014


Python is telling you, that Stephen, meaning the Variable is not 
defined. Now you can solve this by either defining Stephen, or making a 
temp variable of type string for comparison.
Defining Stephen:
#BEGIN SCRIPT#
Stephen = 'Stephen'  # This is now a variable of type string that equals 
'Stephen'.
person = input("What is your name?:")
if person == Stephen:
     print('Hello ', Stephen)
else:
     print('Hello ', person)

#END SCRIPT#

By the way I assume Python 3 is the version you are using, since that is 
what I use. Let me know if you get any further tracebacks.
I hope that explains what it means to define a variable.

--

On 06/10/2014 10:55 AM, Stephen Brazil wrote:
> Hello! I am brand new to python and need to know how to make the 
> attached lines of code work. Should be pretty self-explanatory.
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140623/36627777/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 40476 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20140623/36627777/attachment-0001.png>


More information about the Tutor mailing list