Complete the code to identify the class of an IP address based on its first octet.
if 1 <= first_octet <= [1]: ip_class = 'A'
Class A IP addresses have their first octet in the range 1 to 126.
Complete the code to check if an IP address belongs to Class B based on its first octet.
if [1] <= first_octet <= 191: ip_class = 'B'
Class B IP addresses have their first octet between 128 and 191.
Fix the error in the code to correctly identify Class C IP addresses.
if 192 <= first_octet <= [1]: ip_class = 'C'
Class C IP addresses have their first octet between 192 and 223.
Fill both blanks to complete the code that determines the class of an IP address based on its first octet.
if first_octet >= [1] and first_octet <= [2]: ip_class = 'B'
Class B IP addresses range from 128 to 191 in the first octet.
Fill all three blanks to create a dictionary comprehension that maps IP classes to their first octet ranges.
ip_classes = {
'A': (1, [1]),
'B': ([2], [3]),
'C': (192, 223)
}The ranges are:
Class A: 1-126
Class B: 128-191
Class C: 192-223