I have list like this:
[' name = Badmash Gujjar\n',
' image = \n',
' image =\n',
' caption =\n',
' director = Sameer Butt\n',
' producer =\n',
' writer = Nasir Adeeb\n',
' starring = Saima<br>Shaan (actor)Shaan<br>',
' music = Robin Ghosh\n',
' cinematography =\n',
' editing =\n',
' distributor = \n',
' released = Film date2001']
I want to remove repeated elements from list. I tried following code, but not found any luck. list(set(l)).
Also is there any way to remove HTML tag? thanks
will create the following dictionary (which is probably what you want, since a dictionary doesn’t have repeated keys):
If you want to remove the
<br>tags only, then you can use this:If you need to remove any HTML tags, a more complicated regular expression (or HTML parser) is needed.