Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lysie_10

  • 3 years ago

Regarding problem set 0: I was able to do the problem set more or less no problem but I wasn't sure how to include a space between my outputs... x = raw_input('What is your date of birth?') y = raw_input ('What is your last name?') print y+x

  • This Question is Open
  1. lopus
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    print x,"",y

  2. bwCA
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    print x, y

  3. sontung1404
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    you should learn how to use the `%` in string. That will be useful the. For your question: `print "%s %s" % (x, y)` whenever the computer sees `%` it will look at the tuple and replace `%` by the element in the same index. But remember you must use the `%` which is suitable with the element in the same index For example: `%s` for `string` `%i` for `int` (integer) More information: http://stackoverflow.com/questions/4480278/list-of-python-format-characters

  4. bwCA
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    or the str.format() method http://docs.python.org/library/string.html#format-string-syntax

  5. lysie_10
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Thanks for the help!

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy