Convert Digits to Binary with Python

preview_player
Показать описание
Let's write a function that converts a string of digits into binary code. The function will take a string of digits as input and will return a binary string. We will use a simple if-else loop to replace any digit below 5 with '0' and any digit 5 and above with '1'.
Рекомендации по теме