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

thomasC

for problem set 3, how do refresh the tuple inside the function if you use the function more than once?

  • 2 years ago
  • 2 years ago

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

    Not sure what you mean by your question. A tuple doesn't get refreshed. Do you want to start the tuple from scratch again and rerun the function? You can just redeclare the tuple as an empty tuple before you run the function on it again.

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

    if you are passing a tuple to a function - pass an empty tuple if the tuple is created 'inside' the function it shouldn't need to be refreshed http://pastebin.com/uA9wua4L

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

    thx guys, I guess my question wasn't really clear. what i meant was, my function subStringMatchExact returns a tuple z(), in which I add the starting points of "key" in "target". However, if i use the function more than once, the values returned from the different uses gets stacked together. so i was wondering how would I solve this problem. thx a lot

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

    hmm, it might be easier if you posted your code - using dpaste.com or codepad.com or pastebin.com ....... if you have a variable that points to a tuple and at some point you want the variable to point to an empty tuple then just reassign the variable to an empty tuple: http://pastebin.com/5KCwKqhd

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