KateWilson

Из 10сс в 2сс(bin в Python)

Aug 20th, 2019
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. #Как работает функция bin в Python.(Перевод из 10сс в 2сс)
  2. n = int(input())
  3. b = ''
  4.  
  5. while n > 0:
  6.     b = str(n % 2) + b
  7.     n = n // 2
  8.  
  9. print(b)
Advertisement
Add Comment
Please, Sign In to add comment