To_bytes()

Report a typo

Write a code that takes a given number, converts it to a bytes object and outputs the sum of its bytes.

A little spoiler: the test numbers are going to be greater than 255, so you're going to need at least 2 bytes to encode them.

Sample Input 1:

2024

Sample Output 1:

239
Write a program in Python 3





___

Create a free account to access the full topic