CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List
Python Code Walkthrough #52

One Character Two Bytes

hardBytes

📄 Code

Read carefully — what does this print?
1word: str = "caf\xe9"
2data: bytes = word.encode()
3print(len(word), len(data))
4print(data)
5print(len("abc".encode()))
6print(data.decode() == word)

🎯 Your Answer

← Previous