Question: Do this code without importing re . An IP address is a set of four numbers that identifies a device on the internet or a
Do this code without importing re
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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
