Question: Exercise 1: Write a Python function to remove leading zeros from an IP address. For example: print(simplify IP{255.036.01.02)) 255.36.1.2 print(simplifXmIpf128.10.0.001)) 128.10.0.1 Exercise 2: Write a

 Exercise 1: Write a Python function to remove leading zeros from

Exercise 1: Write a Python function to remove leading zeros from an IP address. For example: print(simplify IP{"255.036.01.02")) 255.36.1.2 print(simplifXmIpf"128.10.0.001")) 128.10.0.1 Exercise 2: Write a Python function to move all periods to the front of a given string. For example: print(dots2front("thisuikeatest")) thisisatest' print(dots2front("1.23.456.7..")) 1234567' Exercise 3: a. Write a Python non recursive function that returns the first word that is repeated in a given string. Hint: use membership operator 'in'. For example: print(firstRepeat("1 2 3 2 4 1 2 3 5")) '1' print(firstRepeat("zero one and two and one")) one b. Rewrite part(a) using a recursive function. Hint - use slicing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!