0

Here's my code

def in_parentheses(string):
    txt = string[string.find("(")+1:string.find(")")]
    return txt
Barmar
  • 741,623
  • 53
  • 500
  • 612
  • `find()` returns `-1` if it can't find the character. You need to check for that. Or you could just use a regular expression. – Barmar Jan 10 '21 at 06:01
  • You should also start searching for `)` at the position of `(`. The second argument to `find()` is useful for this. – Barmar Jan 10 '21 at 06:03

0 Answers0