0

I'm trying to underline my text in python using Unicode "\u0332"
I'm using Kali Linux and I'm running this code in Kali terminal to run this Code.
Here is my Python Code.

# This will print Unicode Character ('combining low line' U+0332) as underlines 

#sentence = s
s = "$Hello I want to underline my text$"

if (s[0]=="$" and s[len(s)-1]=="$"):
    s = s[1:]#removes first $
    s = s[:-1]# removes last char $
    s = "\u0332".join(s)
print(s) 

Output I want

 H̲e̲l̲l̲o̲ ̲I̲ ̲w̲a̲n̲t̲ ̲t̲o̲ ̲u̲n̲d̲e̲r̲l̲i̲n̲e̲ ̲m̲y̲ ̲t̲e̲x̲t

Output I'm getting

Hello I want to underline my text

0 Answers0