E.Tarrent
E.Tarrent

Reputation: 89

python3.4 How to decode string to what I want

I get some string from web use python3.4. Here is string I get:

str="&#60lily&#62"

How to get this result?

str="<lily>"

Upvotes: 1

Views: 46

Answers (1)

Alireza Afzal Aghaei
Alireza Afzal Aghaei

Reputation: 1235

use replace:

str="&#60lily&#62"
str.replace("&#60","<").replace("&#62",">")

Upvotes: 1

Related Questions