subject
Engineering, 06.08.2021 14:40 tyler8670

1: An IP address is divided into 4 sections where each section contains 1-3
digits. An example of an IP address would be 192.168.10.3 . Now IP
addresses have 2 parts; One is the network part while the other one is the
host part. If the network part is 1, we get a special address from the
given IP address where the 1st section will remain as it is and the rest of
the 3 sections will become 0. If the network part is 2, we get a special
address from the given IP address where the first 2 sections will remain as
it is and the rest of the 2 sections will become 0. Same goes for other
values of the network part. For simplicity we will consider the network
part can be 1 or 2 or 3.
Lets see an example:

IP address: 192.168.10.30
If network part = 1 , then special address = 192.0.0.0
If network part = 2 , then special address = 192.168.0.0
If network bits = 3 , then special address = 192.168.10.0

All IP addresses starting like the special address will fall under the same
special network. You will be given the value of the network part and a list
of IP addresses as input. Your task will be to create a dictionary where
the keys will be the unique special addresses and the corresponding values
will be the list of IP addresses that fall under the same special network.

Input format: Value of network part List of IP addresses separated by
β€œ,”

Sample Input 1:
1
192.168.30.10,168.192.100.30,192.15 2.55.10,240.169.10.10,168.200.43.90 ,192.169.100.45

Sample Output 1:
{
β€œ192.0.0.0”: [β€œ192.168.30.10”, β€œ192.152.55.10”, β€œ192.169.100.45”],
β€œ168.0.0.0”: [β€œ168.192.100.30”, β€œ168.200.43.90”],
β€œ240.0.0.0”: [β€œ240.169.10.10”]
}

Sample Input 2:
2
192.168.30.10,168.192.100.30,192.16 8.55.10,240.169.10.10,168.192.43.90 ,192.169.100.45

Sample Output 2:
{
β€œ192.168.0.0”: [β€œ192.168.30.10”, β€œ192.168.55.10”],
β€œ168.192.0.0”: [β€œ168.192.100.30”, β€œ168.192.43.90”],
β€œ240.169.0.0”: [β€œ240.169.10.10”]
β€œ192.169.0.0”: [β€œ192.169.100.45”]
}

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
Answers: 3
question
Engineering, 04.07.2019 18:20
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
You know the right answer?
1: An IP address is divided into 4 sections where each section contains 1-3
digits. An examp...
Questions
question
Mathematics, 26.03.2021 17:50
question
Mathematics, 26.03.2021 17:50
Questions on the website: 13722363