Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
E722 do not use bare except
import ipaddress
ip_list = []
for i in range(int(input())):
ip_list.append(input())
def is_ipaddress(ip_list):
for i in ip_list:
try:
if ipaddress.ip_address(i):
print('True')
except:
print('False')
is_ipaddress(ip_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment