Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python class: 1. Write a Python script which asks the user to input 2 numbers (a & b). 2. Assign variable quotient a / b

Python class:

1. Write a Python script which asks the user to input 2 numbers (a & b).

2. Assign variable quotient a / b and power a ** b.

3. Use try/except blocks to print error messages for:

a.) Division by zero Error: Cannot divide by zero.

b.) Over flow Error: a**b is too large.

Look up the proper exception names for each case above. Hint: Use 2 separate try/except blocks. Hint 2: Integers cannot return an over flow exception. Convert a and b to floats.

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

Step: 3

blur-text-image

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

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions