Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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'

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

4. Define the word measurement.

Answered: 1 week ago

Question

2. What should an employer do when facing an OSHA inspection?

Answered: 1 week ago