A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

I have just finished problem set 0. I have it asking for first name, then last name. My question is... Is there a way to assign a variable to the users inputed data (i.e. the name they enter? )

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm not sure what you mean. You want to assign a variable to store the data? Did you try first_name = raw_input('Enter first name')

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

    no but after trying that it works thanks so much. sorry for the stupid question

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

    No worries at all. Just remember that the calling raw_input will give you a string just like typing one directly into the code does. It just takes the string from the user as the code is running rather than having to be set by hand. So it's like saying first_name = 'Bob' except that you don't have to know what the user will enter when you write the code.

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

    Cool, makes sense. You seem to really know what you're doing. I'm literally brand new with computer programing to the point that I had never even heard of Python until yesterday. I realized I have to learn alot of the terminology first before actually utilizing it but as I briefly glance at problem set 1 it seems overwhelming. Is this something to you eventually just get the hang of or am I a lost cause?

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

    Did you watch the first 2 videos? If not, be sure to do that, and do the readings before trying the assignments. Also, don't be afraid to play around with the code to make sure you understand what it's doing. Finally ask for help. No question is too silly and there are lots of people who are willing to lend a hand.

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

    Yeah, I need to look at the readings. Thanks for your help

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

    Polpak, Thank you, the above dialogue was quite helpful for me, I had only watched the first video/lecture and was trying to do assign. 0 and finding myself overwhelmed! I'll go back and watch the second and do the readings before attempting the assignment - even so- your explanation of the raw_input was helpful. -Romi

  8. 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

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.