Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lysie_10

  • 2 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
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    print x,"",y

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

    print x, y

  3. sontung1404
    • 2 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
    • 2 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
    • 2 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.