0% found this document useful (0 votes)
140 views

Assignment Exception Handling

This document provides two problems to solve for an assignment. The first is to write a function that computes 5/0 and uses try/except to catch the exception. The second is to write a program that generates all sentences with subjects from ["Americans", "Indians"] verbs from ["Play", "watch"] and objects from ["Baseball","cricket"], printing the output. The solutions should be submitted as Jupyter notebooks for evaluation.

Uploaded by

Hrisav Bhowmick
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
140 views

Assignment Exception Handling

This document provides two problems to solve for an assignment. The first is to write a function that computes 5/0 and uses try/except to catch the exception. The second is to write a program that generates all sentences with subjects from ["Americans", "Indians"] verbs from ["Play", "watch"] and objects from ["Baseball","cricket"], printing the output. The solutions should be submitted as Jupyter notebooks for evaluation.

Uploaded by

Hrisav Bhowmick
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

Introduction
This assignment will help you to consolidate the concepts learnt in the session.

2.Problem Statement

1. Write a function to compute 5/0 and use try/except to catch the exceptions.

2. Implement a Python program to generate all sentences where subject is in


["Americans", "Indians"] and verb is in ["Play", "watch"] and the object is in
["Baseball","cricket"].

Hint: Subject,Verb and Object should be declared in the program as shown below.

subjects=["Americans ","Indians"]
verbs=["play","watch"]
objects=["Baseball","Cricket"]

Output should come as below:

Americans play Baseball.


Americans play Cricket.
Americans watch Baseball.
Americans watch Cricket.
Indians play Baseball.
Indians play Cricket.
Indians watch Baseball.
Indians watch Cricket.

NOTE:ThesolutionsharedthroughGithubshouldcontainthesource codeusedandthe
screenshotoftheoutput.

3.Output
This assignment consists of 200 marks and the solution file needs to be submitted in the
upcoming session in .ipynb format for evaluation.

You might also like