Simple Problems: Caps and Commas

Kyle E Kyle_E2006 at hotmail.com
Mon Oct 27 00:24:46 EST 2003


I wrote a program that asks a user questions and records the answers and
prints them out at the end. Pretty simple... but I have a few things that I
don't like about it.
----------------------------------------------
print "Do you have a P.O. Box?"
poan = raw_input ("> ")
if poan == "yes":
    print "What is your P.O. Box number?"
    pobox = input ("> ")
----------------------------------------------
When someone answers "Yes" with cap first letter it determines that "yes"
does not equal "Yes" what are some possible ways to resolve this issue?
======================================
Secondly I'm having a problem with listing information after all user input
"strings" are assigned to various words.

I tried this:
-----------------------------------------------
print "Name: ", fname, mname, lname
print "Address: ",saddy, ",",city, ",",state, ",",zip
-----------------------------------------------

But I get extra spaces after each value:
"Name: Firstname , Middlename , Lastname"
"Address: Street Address , City , State , Zip"

When it should look like this:
"Name: Firstname, Middlename, Lastname"
"Address: Street Address, City, State, Zip"






More information about the Python-list mailing list