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,373
  • 7
  • 29
  • 52

0 Answers0