Question: Write a group of required functions for text processing in the script p5.py. The input test_string should be a single string. Implement the count_digit

Write a group of required functions for text processing in the scriptp5.py. The input test_string should be a single string. Implement the count_digit

Write a group of required functions for text processing in the script p5.py. The input test_string should be a single string. Implement the count_digit (test_string) function and return the number of digital char- acters 0-9 in the test_string. Implement the check_isogram (test_string) function and return the bool variable to indicate whether test_string has duplicate letters. If test_string is an isogram, then the function returns True. If test_string is not an isogram, then the function returns False. Implement the join(original_string, inserted_list) function and return a new string which made by joining characters in Inserted_list with original_string inserted between every element. Implement the search (test_string, sub) function and return the highest index in test_string where substring sub is found. If not found, it returns -1. Testing: Suppose you saved your script p5.py in C:\Users\USERNAME\Documents\lab2. In IDLE, you should test your script p5.py in the Python shell with >>> import sys >>> sys.path.append(r"C:\Users\USERNAME\Documents\lab2") >>> import p5 >>> test_str = "Alice was born in 2000 and born in hong kong." >>> p5.count_digit (test_str) 4 >>> p5.check_isogram(test_str) False >>> p5.search(test_str, "born") 27 >>>p5.search(test_str, "now") -1 >>> p5.join('-', ['a','b', 'c']) 'a-b-c'

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!