I want to replace the number sign (#) with a character similar to that called music sharp sign (♯). I tried the following line but didnt work.
res['n'].replace('#', '♯')
I also tried these and also didnt work fine.
res['n'].replace('#', u'♯')
res['n'].replace('#', '\xe2')
Anyone got any idea about the situation?
res?replace()to modify the string in place?replace()doesn't do that; it creates a new string. You would need to writeres['n'] = res['n'].replace('#', '♯').'\xe2\x99\xaf'.decode('utf-8') == u'\u266f'.