Skip to content
Advertisement

how to convert bytes to binary using python

so i want convert bytes to binary in python, but when i run it, there’s none in the result and i got error:

‘NoneType’ object is not iterable

here’s the code i tried

JavaScript

Advertisement

Answer

Your function currently returns None because there’s no return statement. Perhaps instead of using print, you should modify your functions to return an array of outputs.

I suspect what you have in mind is something like this.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement