Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Create a custom Python module named arithmetic.py. This module must contain four functions as follows: total that takes two numbers as arguments and prints

3. Create a custom Python module named arithmetic.py. This module must contain four functions as follows: total that takes two numbers as arguments and prints their sum accurate to one decimal place. difference that takes two numbers as arguments and prints their positive difference accurate to one decimal place. product that takes two numbers as arguments and returns their product. quotient that takes two numbers as arguments and returns the quotient of the first argument divided by the second argument. Write a program named program5_3.py that imports the arithmetic module, prompts the user to enter two numbers, and tests all four methods in the module.The numbers entered should be type float. The main function should print the values returned by the product and quotient functions accurate to two decimal places. SAMPLE OUTPUT Enter a number 2.5 Enter another number 5 The total is 7.5 The difference is 2.5 The product is 12.50 The quotient is 0.50

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

ISBN: 0805360476, 978-0805360479

More Books

Students also viewed these Databases questions