Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An IP address is a set of four numbers that identifies a device on the internet or a local area network. These four numbers are
An IP address is a set of four numbers that identifies a device on the internet or a local area network. These four numbers are separated by period when written in decimal representation. The four numbers are whole numbers limited from up to An IP address is valid if it consists of four numbers limited from up to with periods in between eg Develop a function that will return a tuple of valid IP addresses in a given text.
import string
txt "Hello my ip address is and I always listen to the radio I know a lot about"
IP addresses and that is a valid ip and is not."
txt "Hackers get the IP address of people but I am not a hacker so I just ask them about it
"Sometimes they say or Others say but I know its wrong."
def listvalidiptext:
# This function extracts valid IP address from a given text
# YOUR CODE HERE
raise NotImplementedError
txt should return
txt should return An IP address is a set of four numbers that identifies a device on the internet or a local area network. These four numbers are separated by period
when written in decimal representation. The four numbers are whole numbers limited from up to An IP address is valid if it consists of four numbers
limited from up to with periods in between eg Develop a function that will return a tuple of valid IP addresses in a given text.
In : import string
txt "Hello my ip address is and I always listen to the radio I know a lot about"
IP addresses and that is a valid ip and is not."
txt "Hackers get the IP address of people but I am not a hacker so I just ask them about it
"Sometimes they say or Others say but I know its wrong."
def listvalidiptext:
# This function extracts valid IP address from a given text
# YOUR CODE HERE
raise NotImplementedError
In : # DO NOT MODIFY, THIS IS UNIT TESTING! pt
from nose.tools import assertequal
assertequallistvalidiptxt
In : # DO NOT MODIFY, THIS IS UNIT TESTING! pt
from nose.tools import assertequal
assertequalistvalidiptxt
In : # HIDDEN TEST pt
In : # SAMPLE TEST, DO NOT MODIFY, JUST EXECUTE ONLY FOR OUTPUT
# You can add a cell below if you need to test a different input
printlistvalidiptxt
printlistvalidiptxt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started