File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import socket
2
+
3
+ #Remove Duplicates from list - Input (ipaddress)1 | Output (status)1
4
+ def validate_ip_logic (ip_address ):
5
+ valid_host = ip_address .split ("." )
6
+ len_host = len (valid_host )
7
+ if (len_host < 4 ) or (len_host > 4 ):
8
+ status = False
9
+ elif len_host == 4 :
10
+ for i in valid_host :
11
+ if (int (i )< 0 ) or (int (i )> 255 ):
12
+ status = False
13
+ break
14
+ if valid :
15
+ status = True
16
+ return status
17
+
18
+ #Remove Duplicates from list - Input (ipaddress)1 | Output (status)1
19
+ def validate_ip (ip_address ):
20
+ status = ""
21
+ try :
22
+ socket .inet_aton (ip_address )
23
+ status = True
24
+ except socket .error :
25
+ status = False
26
+ return status
27
+
1
28
#Remove Duplicates from list - Input (list)1 | Output (list)1
2
29
def remove_duplicate_list (input_list ):
3
30
output_list = list (set (input_list ))
You can’t perform that action at this time.
0 commit comments