ip = "192.168.1.1asdasd"
# for ip_addr in ip.split('.'):
#     if ip_addr.isdigit():
#         print(f"{ip_addr} is digit") 
#     else:
#         print(f"{ip_addr} is alpha")
import re
ipv4_regex = re.compile(r'^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$')
if ipv4_regex.match(ip):
    print("IP its an IP")
else:
    print("Not and IP")