Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

josh9600 Group Title

i just did problem set #0 from lecture 1 . i wrote the program but am not sure if its correct it works in python but when i save it as ps0.py i enter the birth and then the last name and it disappears

  • 2 years ago
  • 2 years ago

  • This Question is Open
  1. MakaiMcClintock Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    How are you trying to run the code?

    • 2 years ago
  2. shandelman Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    Show us the code. It's almost always extremely hard to help someone based on a vague description of what's going on...we need the specifics.

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

    I think it might be an issue with Python....i have seen so many times it lost the connection. Please try to save your code one more time by deleting your ps0.py file and run it again. I am sure this will work.

    • 2 years ago
    1 Attachment
  4. Vladislav Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    this is normal operation Python, just add raw_input() in the end, and you can run this program

    • 2 years ago
  5. Vladislav Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    or open this file in IDLE and click F5

    • 2 years ago
  6. Vladislav Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    my first message about run in command line

    • 2 years ago
  7. Vladislav Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    this is my code

    • 2 years ago
    1 Attachment
  8. josh9600 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    sorry for not checking this sooner but the code i wrote is x = str(raw_input('Enter date of birth: ')) y = str(raw_input('Enter last name: ')) print (y) + (x)

    • 2 years ago
  9. shandelman Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    Okay, first of all, there's nothing really wrong with your code. Two minor points: 1) You don't have to use the str() function, because raw_input() returns a string as is. 2) If you want a space in between y and x when you print them, you have a couple of options. You can do "print y + ' ' + x" (no parentheses necessary" or you could do "print y,x"...if you separate by a comma, it puts a space in between that data. Or you could do "print '%s %s' % (y,x)" which formats the data for you. It's mostly a matter of taste. So...the real question is "Why does everything disappear?". I'm going to take a guess here: you are not running your code in IDLE, you're running it by creating the file, and then looking for the file and double clicking on it. Am I right? To run your code in IDLE, open up IDLE, open up the file, and then hit F5. It will run in the IDLE window. If you really want to be able to double click on your file and not have it close immediately as soon as it's done running (this is a perfectly reasonable thing to want to do), then you can fix this by simply adding another raw_input() function as the very last line of your code. Then your code will wait for you to press Enter before it closes.

    • 2 years ago
  10. josh9600 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    thank you so much that helped me a lot, greatly appreciated

    • 2 years ago
  11. shandelman Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    Anytime!

    • 2 years ago
  12. lopus Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    search in yours programs python (GUI), can copy you code or open here, run F5

    • one year ago
    • Attachments:

See more questions >>>

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.