Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON 3 Using string method replace() and string method translate() and using regular expressions. Compare the running time of each using the experimental running time
PYTHON 3 Using string method replace() and string method translate() and using regular expressions. Compare the running time of each using the experimental running time analysis framework.
Your output should look like this: Time analysis on the replace(), translate(), and regular expression methods of removing punctuation from randomly generated strings using the timing framework from Chapter 10. Average Run-Time of testRegEx(30) is 3.120041e-06 seconds. Average Run-Time of testRegEx1280) is 2.340007e-05 seconds. Average Run-Time of testRegEx(530) is 1.872003-05 seconds. Average Run-Time of test Translate30) is 1.559997e-06 seconds. Average Run-Time of test Translate[280) is 6.240058e-06 seconds. Average Run-Time of testTranslate(530) is 1.560001e-05 seconds. Average Run-Time of testReplace(30) is 4.680014e-06 seconds. Average Run-Time of testReplace(280) is 1.092002e-05 seconds. Average Run-Time of testReplace(530) is 1.872005e-05 seconds. timeit. Time() was used for greater accuracy. the translate function was the most efficient based on time run analysis. Time analysis on the replace(), translate(), and regular expression methods of removing punctuation from randomly generated Strings using timeit. Timer The average time from on 1,000,000 runs for each input, and each function, is reported. Testing szok-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