问题
print("hello")
The output should be the word "hello", but underlined.
回答1:
You can do it by using escape characters.
print "\033[4mhello\033[0m"
回答2:
You may type
print("\u0332".join("hello ")) enter image description here
回答3:
string = 'Hello world'
emptystring = ''
for i in range(0, len(string)):
if string[i] == ' ':
emptystring = emptystring + string[i]
else:
emptystring= emptystring+string[i]+str('\u0332')
print(emptystring)
Here is the output
来源:https://stackoverflow.com/questions/35401019/how-do-i-print-something-underlined-in-python