LINUX.ORG.RU

История изменений

Исправление conformist, (текущая версия) :

state_ip=['172.20.0.3/24', '192.168.168.1/24', '192.168.195.1/24', '192.168.199.1/24']
current_ifip=['172.20.0.3/24', '192.168.168.1/24', '192.168.195.1/24', '192.168.199.1/24']

for ip in current_ifip:
    if ip in state_ip:
        print('yes')
    else:
        print('no')

P.S. python.

Исходная версия conformist, :

state_ip=['172.20.0.3/24', '192.168.168.1/24', '192.168.195.1/24', '192.168.199.1/24']
current_ifip=['172.20.0.3/24', '192.168.168.1/24', '192.168.195.1/24', '192.168.199.1/24']

for ip in current_ifip:
    if ip in state_ip:
        print('yes')
    else:
        print('no')