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

RCMorea

I am working slowly through this course, doing both the assignments and the "finger exercises" in the book. I am now on finger exercise 3.2, which gives a string of numbers separated by commas, and asks they be added togther. The book demonstrates how to do this with a string not separated by commas. The lectures have shown how to do it with a list. A string separated by commas is something I have not seen an example of. Did I miss it? Is the expectation to Google it? I don't mind doing that, I'm just wondering whether I missed something...

  • one year ago
  • one year ago

  • This Question is Closed
  1. RCMorea
    Best Response
    You've already chosen the best response.
    Medals 0

    BTW, sorry for the double post (I put it in Comp Sci, not realizing there is a separate space for the MIT 6.00). It's a wonder I can tie my shoes let alone program, but I struggle through.

    • one year ago
  2. bwCA
    Best Response
    You've already chosen the best response.
    Medals 1

    i would think that you have to put those strings into a data structure. either a list, or a tuple or a dictionary or a set. a sequence data type most likely. perhaps the split() string method might help. http://docs.python.org/2.7/library/stdtypes.html#str.split And a walk thru the Tutorial in the help docs wouldn't hurt: http://docs.python.org/2.7/tutorial/index.html

    • one year ago
  3. RCMorea
    Best Response
    You've already chosen the best response.
    Medals 0

    bwCA, Thanks. I did wind up using .split on the string to generate an equivalent list of floats. It just seemed the data could have been provided in list form to begin with as easily as string form, so converting from string to list seemed like possibly missing the point. Especially since I don't recall the professor or TA talking about such conversions. But that is what I did and it worked. Thanks!

    • one year ago
  4. bwCA
    Best Response
    You've already chosen the best response.
    Medals 1

    The purpose of the course is not to teach you the Python programming language - it is to teach you computer science and programming methods. They expect you to avail yourself to the wealth of help and documentation available for the language itself.

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