79243806

Date: 2024-12-02 11:09:08
Score: 1
Natty:
Report link

Thanks to The fourth bird !

I understood what was going wrong and i finally ended up with this working code (for any special characters but keep spaces) :

titre = "4K ULtra HD | SAMSUNG UHD Demo׃ LED TV"
print("original : "+ titre)
for i in titre:
    if i.isalnum()==False:
        if i.isspace()==False:
            titre=titre.replace(i,"-")
print("modified : "+ titre)

#Output : modified : 4K ULtra HD - SAMSUNG UHD Demo- LED TV
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Garbez François