Bytes Decode in Python
Level 261 keystrokes
This decodes bytes to a string using UTF-8 encoding.
Python code
# The b prefix makes a bytes literal, not a str1data = b"hello"# decode("utf-8") interprets the bytes as UTF-8 and returns a str2decoded = data.decode("utf-8")# Prints hello, now without the b'' prefix3print(decoded)Output
hello
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Python code and how often they appear.
"× 4(× 2)× 2=× 2-× 1.× 1