#comments

Paul McNett p at ulmcnett.com
Mon Sep 13 17:36:34 EDT 2004


Your subject is about comments, but your problem is with 
your print statements. See below.

Ken Parkes writes:

>     data=raw_input("Type something  ") # spaces after
> "something" myInput=data
>     print "You typed " myInput  # and again
>     print "The fourth character is  "  myInput[3]  # and
> again

Try this:

data=raw_input("Type something  ") # spaces after "something"
myInput=data
print "You typed %s" % myInput # and again
try:
	print "The fourth character is %s" % myInput[3] # and again
except IndexError:
	print "There is no fourth character."

-- 
Paul McNett
Independent Software Consultant
http://www.paulmcnett.com



More information about the Python-list mailing list