how to return the characters in string "s" in outermost pair of matching quotes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dragonwolf
    New Member
    • Nov 2011
    • 1

    how to return the characters in string "s" in outermost pair of matching quotes

    suppose we have to return the charccters in string "s" which are contained in the outermost pair of matching quotes and return nothing when there are no quotes
    Code:
     c = s.find('""')
        if c != -1:
            for item in s:
                if c < len(z) -1 :
                    if c[k+1] == '""':
                        return char
                    else:
                        char = char + s[k+1]
                        c = c+ 1
                        return char
    this is my code but its not working,can any one help me out
    thanks
    Last edited by bvdet; Nov 5 '11, 01:42 AM. Reason: Add code tags
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    Not from what you posted
    1. "s" is not defined
    2. there is at least one indentation error
    3. there is a problem with at least one return
    4. "z" had not been declared
    5. "k" had not been declared
    6. "char" had not been declared
    7. what happens if '""' is not found

    If anyone falls for the old post-gobbledygook-to-get-someone-to-do-your-homework-for-you, then they are not someone you want to take advice from, and if that is what this is, please don't waste our time.

    Comment

    Working...