The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #166
str(("Python".encode()))
The type of str(("Python".encode())) is a string. Even though "Python" is first encoded to a bytes object, the str() function then casts it to a string. Interestingly enough, the representation of str(("Python".encode())) will contain the bytes literal suffix e.g. b'Python' . (docs.python.org/3/c-api/bytes.html)
What is the type of the object below?
— The Python Quiz (@thepythonquiz) August 23, 2020
str(("Python".encode()))
A string
A bytes object#python #python3 #pythonprogramming #learnpython
Question difficulty: 🔵🔵🔵🔵🔵