Skip to content

Instantly share code, notes, and snippets.

@emilgaripov
Created May 4, 2020 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilgaripov/620c86540276f493ae7c902a9ea04f2c to your computer and use it in GitHub Desktop.
Save emilgaripov/620c86540276f493ae7c902a9ea04f2c to your computer and use it in GitHub Desktop.
Print statement
'''
Задание 4.7
Преобразовать MAC-адрес mac в двоичную строку такого вида:
'101010101010101010111011101110111100110011001100'
Ограничение: Все задания надо выполнять используя только пройденные темы.
'''
mac = 'AAAA:BBBB:CCCC'
mac_ = mac.strip().split(':')
mac_ = ''.join(mac_)
print(mac_, type(mac_))
mac_ = bin(mac_)
mac_ = mac_.lstrip('0b')
print(mac_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment