The Artima Developer Community
Sponsored Link

Python Answers Forum
What am I doing wrong?

4 replies on 1 page. Most recent reply: Feb 2, 2006 12:51 AM by ryan l

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
first last

Posts: 1
Nickname: arpgme
Registered: Nov, 2005

What am I doing wrong? Posted: Nov 12, 2005 8:11 PM
Reply to this message Reply
Advertisement
here is the code


S = raw_input("How are you?:")
if S = "fine" then print " I am also " print S "thanks for asking"


Marshall Feis

Posts: 2
Nickname: fiddlinboy
Registered: Nov, 2005

Re: What am I doing wrong? Posted: Nov 18, 2005 7:02 PM
Reply to this message Reply
s = raw_input("How are you?: ")
if s == "fine":
print "I am also %s, thanks for asking." % (s)

Marshall Feis

Posts: 2
Nickname: fiddlinboy
Registered: Nov, 2005

Re: What am I doing wrong? Posted: Nov 18, 2005 7:05 PM
Reply to this message Reply
(Sorry, forgot about the code tags. Spacing is very important in Python.)


s = raw_input("How are you?: ")
if s == "fine":
print "I am also %s, thanks for asking." % (s)

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: What am I doing wrong? Posted: Nov 19, 2005 9:59 PM
Reply to this message Reply
Actually, you should use pre tags not code tags. For example:

s = raw_input( 'How the heck art thou? ' )
if s == 'fine':
print "Yeah, right you're %s. What a load of crap! I mean really." % s
else:
print '%s? What do you mean by "%s"? You expect me, a stupid program to understand that?' % (s,s)

ryan l

Posts: 1
Nickname: rryanl
Registered: Feb, 2006

Re: What am I doing wrong? Posted: Feb 2, 2006 12:51 AM
Reply to this message Reply
Dont forget your , when your close a string and start it up again ^^

Flat View: This topic has 4 replies on 1 page
Topic: Encoding Problem :( (newbie question) Previous Topic   Next Topic Topic: pls..its urgent..copy a file from local to remote machine using ftp

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use