str.encode()
Here is what the above code is Doing:
1. We’re creating a variable called ‘message’ and setting it equal to the string ‘Hello, world!’.
2. We’re using the ‘encode’ method to convert the string into bytes.
3. We’re printing the bytes to the console.