'De' =='De' is False! Actually, the second "de" was two letters. [Python]

As the title says. If you copy and paste the title 'de'=='de' and execute it in python, it will be False.

It was puzzling, but when I looked it up, the second character, de, was actually composed of te and `` dakuten''.

a = 'De' 
b = 'De'

text = f'''

How are the two des displayed?
The first one: {a}
Second: {b}

Are the two des the same?: {a==b}

How long is each string?
a : {len(a)}letter
b : {len(b)}letter

What are the first and second letters of b?
b[0] : {b[0]}
b[1] : {b[1]}

By the way, what happens if you use a byte string?
a : {a.encode()}
b : {b.encode()}

"The second de was actually two letters!"
'''

print(text)
スクリーンショット 2020-06-09 午前2.59.47.png

Recommended Posts

'De' =='De' is False! Actually, the second "de" was two letters. [Python]
[Python] What is @? (About the decorator)
[python] What is the sorted key?
What is the python underscore (_) for?
Where is the python instantiation process written?
What is "mahjong" in the Python library? ??
[python] [meta] Is the type of python a type?
Effective Python was, as the name implies, Effective