0

I would like to extract 'test' from '<AAA>test</AAA>'. Here is my code. I'm sure it can be improved :

test = '<AAA>test</AAA>'

test = test.replace('</AAA>', '<AAA>')
test = test.split('<AAA>')
test = test[1]

print(test)

Any idea on how to write it in a lighter way ?

Many thanks...

wiltomap
  • 3,933
  • 8
  • 37
  • 54

0 Answers0