Input again (!!@#&#$^@#$)

Gabe Newcomb Gabe.Newcomb at noetix.com
Fri Jul 12 13:27:11 EDT 2002


a couple things:
 
1. remember to use == instead of = for checking for equivalence (= is
only for assignment)
2. I don't know if this was just your pseudocode, but remember there's
no 'then' keyword in python, just the colon
3. raw_input will return the newline symbol (\n) I think, so try
something like:
    if raw_input.startswith('Yes'):
        do_something...
    else:
        do_something_else
 
 
HTH,
Gabe
   

-----Original Message-----
From: Seth Ainsley [mailto:sethtoday at hotmail.com]
Sent: Friday, July 12, 2002 9:37 AM
To: all_things_python at yahoogroups.com; python-list at python.org
Subject: Input again (!!@#&#$^@#$)


Sorry,
Input again.  Thanks for the answer on what I thought was raw.input (but
was actually raw_input), but how would it be for me to get something
like the following to work:
input = raw_input('What's your answer? ')
if input = "Yes" then print "Something"
else print "Something else"
What I'm trying to do here is basically tell Python if the person
answers "Yes" then print "Something".  If it's anything else, print
"Something else."  But this doesn't work.  Any suggestions?
Thanks for your help in advance,
Seth A.

  _____  

Send and receive Hotmail on your mobile device: Click Here
<http://g.msn.com/1HM1ENCA/c152??PI=44318> 
-- http://mail.python.org/mailman/listinfo/python-list 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020712/c8f5cb62/attachment.html>


More information about the Python-list mailing list