Question: Write a program called 'tracer.py' that may be used to assist with debugging Python programs. Given the name of a Python program as input, 'tracer.py'

 Write a program called 'tracer.py' that may be used to assistwith debugging Python programs. Given the name of a Python program as

Write a program called 'tracer.py' that may be used to assist with debugging Python programs. Given the name of a Python program as input, 'tracer.py' will insert a trace statement at the beginning of each function definition. Given the name of a program that already contains trace statements, 'tracer.py' will remove them Say, for example, we have the following program, 'rfunction.py' # reverse a string, Hussein Suleman, 18 march 2015 def reverse string (sentence): new sent for i in range len (sentence)-1,-1,-1): new sent -new sent + sentence [i] return new sent def main O: sent -input ("Enter a sentence:") print (reversestring (sent)) print (reverse string (sent+sent)) main ) Here's a sample of its behaviour: Enter a sentence: how now brown cow woc nworb won woh woc nworb won wohwoc nworb won who Given the file name 'rfunction.py' as input, 'tracer.py will produce the following transformation: """DEBUG""" # Reverse a string, Hussein Suleman, 18 march 2015 def reverse string (sentence): ""DEBUG""":print ('reverse string') new sent- for i in range (len (sentence)-1,-1,-1): new sentnew sent sentence [i] return new sent def main O: DEBUG""": print ('main') sentinput ("Enter a sentence: ") print (reversestring (sent)) print (reverse string (sent+sent))

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!