Duality

Report a typo

We have converted a string 'corgi' to bytes. Look at the following lines of code and pick a correct statement to describe the output:

never_bites = b'corgi'

# 1
print(never_bites)

# 2
print(never_bites[0] + never_bites[1] + never_bites[2] + never_bites[3] + never_bites[4])

Bytes objects may not be what they seem: though symbols can be represented as a string with b prefix, they are converted to corresponding code points. Code points, in turn, are just numbers, so it's possible to add them up.
Select one option from the list
___

Create a free account to access the full topic