question archive import pdb; pdb

import pdb; pdb

Subject:Computer SciencePrice:15.86 Bought3

import pdb; pdb.set_trace()

def divide(n, e, f):

print(n)

breakpoint()

return f / e

 

a,b = 0,1

name = "John Yoon"

print(divide(name, a,b))

 

As you run, enter "c" for each (pdb) prompt. a screenshot of a sample run is as follows:

 

>>> (executing cell "" (line 1 of "hw1pdb.py"))

> c:\backtemp\johns-backup\mercy\455secintellcoding\py\hw1pdb.py

(4)<module>()

-> def divide(n, e, f):

(Pdb) c

John Yoon

> c:\backtemp\johns-backup\mercy\455secintellcoding\py\hw1pdb.py(8)divide()

-> return f / e

(Pdb) c

Traceback (most recent call last):

File "C:\backTemp\Johns-Backup\Mercy\455secIntellcoding\py\hw1pdb.py", line 13, in <module>

print(divide(name, a,b))

File "C:\backTemp\Johns-Backup\Mercy\455secIntellcoding\py\hw1pdb.py", line 8, in divide

return f / e

ZeroDivisionError: division by zero

 

>>>


 

Do the following code with your name, (instead of my name "John Yoon"), run the code.


 

Submit

1) Python code

2) Screenshot of your code execution

 

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions