for index, item in enumerate(['вася', 'петя', 'саша'], start=1):
print(f'{item}\nСтрока № {index}')
import ipaddress
mac_addresses = ['aa:bb:cc:aa:bb:11', 'aa:bb:cc:aa:bb:12', 'aa:bb:cc:aa:bb:13', 'aa:bb:cc:aa:bb:14', 'aa:bb:cc:aa:bb:15']
start_ip = ipaddress.ip_address('192.168.0.11')
for index, mac_address in enumerate(mac_addresses):
print(f'MAC {mac_address}\nIP {start_ip + index}\n')
Вывод:
MAC aa:bb:cc:aa:bb:11
IP 192.168.0.11
MAC aa:bb:cc:aa:bb:12
IP 192.168.0.12
MAC aa:bb:cc:aa:bb:13
IP 192.168.0.13
MAC aa:bb:cc:aa:bb:14
IP 192.168.0.14
MAC aa:bb:cc:aa:bb:15
IP 192.168.0.15