This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "<ipython-input-22-a74d06138f75>", line 19 | |
print(vlans | |
^ | |
SyntaxError: unexpected EOF while parsing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 4.5 | |
Из строк command1 и command2 получить список VLANов, | |
которые есть и в команде command1 и в команде command2. | |
Результатом должен быть список: ['1', '3', '8'] | |
Ограничение: Все задания надо выполнять используя только пройденные темы. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "<ipython-input-26-df69e49a2452>", line 17 | |
vlans = set(line1 + line2) | |
^ | |
SyntaxError: invalid syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File "<ipython-input-26-df69e49a2452>", line 17 | |
vlans = set(line1 + line2) | |
^ | |
SyntaxError: invalid syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 4.7 | |
Преобразовать MAC-адрес mac в двоичную строку такого вида: | |
'101010101010101010111011101110111100110011001100' | |
Ограничение: Все задания надо выполнять используя только пройденные темы. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-2-24a72a1aa1d6> in <module> | |
12 mac_ = mac.strip().split(':') | |
13 mac_ = ''.join(mac_) | |
---> 14 mac_ = bin(mac_) | |
15 mac_ = mac_.lstrip('0b') | |
16 print(mac_) | |
TypeError: 'str' object cannot be interpreted as an integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 4.7 | |
Преобразовать MAC-адрес mac в двоичную строку такого вида: | |
'101010101010101010111011101110111100110011001100' | |
Ограничение: Все задания надо выполнять используя только пройденные темы. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AAAABBBBCCCC <class 'str'> | |
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-3-ceea58998966> in <module> | |
13 mac_ = ''.join(mac_) | |
14 print(mac_, type(mac_)) | |
---> 15 mac_ = bin(mac_) | |
16 mac_ = mac_.lstrip('0b') | |
17 print(mac_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 4.7 | |
Преобразовать MAC-адрес mac в двоичную строку такого вида: | |
'101010101010101010111011101110111100110011001100' | |
Ограничение: Все задания надо выполнять используя только пройденные темы. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Задание 5.2 | |
Запросить у пользователя ввод IP-сети в формате: 10.1.1.0/24 | |
Затем вывести информацию о сети и маске в таком формате: | |
Network: | |
10 1 1 0 | |
00001010 00000001 00000001 00000000 |