Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make a python program that takes in three integers as inputs and outputs the largest value. Use a try block to perform all the statements.

Make a python program that takes in three integers as inputs and outputs the largest value. Use a try block to perform all the statements. Use an except block to catch any EOFErrors caused by missing inputs, output the number of inputs read, and output the largest value or "No max" if no inputs are read.

Note: Because inputs are pre-entered when running a program in the zyLabs environment, the system throws the EOFError when inputs are missing. Test the program by running the program in the Develop mode.

Hint: Use a counter to keep track of the number of inputs read and compare the inputs accordingly in the except block when an exception is caught.

Ex: If the input is:

3 75

the output is:

7

Ex: If the input is:

3

the system throws the EOFError and outputs:

1 input(s) read: Max is 3

Ex: If no inputs are entered:

the system throws the EOFError and outputs:

0 input(s) read: No max

Step by Step Solution

3.33 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Heres a Python program that takes three integers as inputs uses a try block ... 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

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Programming questions