From 46d364158d15b1555e21fed70001383ba58902be Mon Sep 17 00:00:00 2001 From: Marsh232 Date: Wed, 7 Sep 2022 13:20:13 +0300 Subject: [PATCH] =?UTF-8?q?Add=20basic=20output=20=E2=84=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 26 +++++++++++++++++++++++--- main.py | 5 +++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 90defdd..126c4e5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ + + + + - + \ No newline at end of file diff --git a/main.py b/main.py index d9f7e95..97544fe 100644 --- a/main.py +++ b/main.py @@ -13,10 +13,11 @@ def main(ip): print('HostMin:', net[1]) print('HostMax:', net[-2]) print('Hosts:', len(list(net.hosts()))) # Выводит кол-во хостовых ip + count = 0 for n_ip in net.hosts(): + count += 1 if str(n_ip) == list_ip[0]: - list_n_ip = str(n_ip).split('.') - print('№ в сети:', list_n_ip[3]) + print('№ в сети:', count) # Выводит какой ip по счёту в сети break