0% found this document useful (0 votes)
13 views1 page

Python Debugging Lab Assignment Guide

This document outlines a lab assignment for a Python debugging course, requiring students to submit their code and outputs in a specified format. The assignment includes tasks such as writing programs to calculate squares and cubes, finding the maximum of three numbers, and comparing lists and tuples, along with demonstrating various debugging techniques. Additionally, students are instructed to handle user input for a mathematical expression and rewrite it using different syntax structures.

Uploaded by

Vikas Mittal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Python Debugging Lab Assignment Guide

This document outlines a lab assignment for a Python debugging course, requiring students to submit their code and outputs in a specified format. The assignment includes tasks such as writing programs to calculate squares and cubes, finding the maximum of three numbers, and comparing lists and tuples, along with demonstrating various debugging techniques. Additionally, students are instructed to handle user input for a mathematical expression and rewrite it using different syntax structures.

Uploaded by

Vikas Mittal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Problem Solving using Python Lab

Lab Assignment 4 (Python Debugging)

NOTE: All students must submit the programs (code with running output) of this assignment in a
single doc/pdf file to their respective faculty of Lab. Title of submission should be as
rollNumber_Group_Name_AssignmentNumber.doc/docx/pdf.

Q1 (a) Write a Python program to find the square and cube of a number.
(b) Pause the execution of above program and enter into interactive debugging using
1)​ pdb.set_trace(),
2)​ breakpoint() and
3)​ command line module (python -m pdb [Link])

Q2
(a)​ Write a Python program to find the maximum of three numbers.
(b)​ Demonstrate the use of step and next commands in the following program:
(c)​ Create 2 breakpoints in the above program using break command and demonstrate the
use of continue command.
(d)​ Disable breakpoints and show the enable/ disable status of breakpoints.

Q3 Create a list and tuple. Compare the equality of the created list and tuple. Show the error, if
any, using post mortem debugging.

Q4 Consider a Python expression (a + b * c - (d / e)).


(a)​ Take values of all variables input from user and print the result.
(b)​ Re-write the above expression to convert it into multiple line statement using “\”, (), [] and
{}.

You might also like