Add details
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:backtempjohns-backupmercy455secintellcodingpyhw1pdb.py
(4)()
-> def divide(n, e, f):
(Pdb) c
John Yoon
> c:backtempjohns-backupmercy455secintellcodingpyhw1pdb.py(8)divide()
-> return f / e
(Pdb) c
Traceback (most recent call last):
File “C:backTempJohns-BackupMercy455secIntellcodingpyhw1pdb.py”, line 13, in
print(divide(name, a,b))
File “C:backTempJohns-BackupMercy455secIntellcodingpyhw1pdb.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
