Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose I ask for two numbers from the user and divide them and then I ask for a number for up to how many decimal

image text in transcribed

Suppose I ask for two numbers from the user and divide them and then I ask for a number for up to how many decimal places they want to print the division. I want to do it by the formatting code method only. I know how to do it by the .format method but I cannot use it because you know the university will consider it cheating because it has not been taught in class. The one I tried in the image is wrong by the way.

Basically I want to replace the 5 in %.5f by any number that is entered by the user.

Thanks in advance.

w=int(input("Enter the number of decimal places: ")) x= int (input("Enter the value of x: ")) y=int(input("Enter the value of y:") ) z=x/y print(" %(xd)f(w,z)) Basically instead of the 5 in \%.5f I want the number input by the user only by this method.l

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

10:16 AM Sun Jan 29 Answered: 1 week ago

Answered: 1 week ago

Question

1. Design an effective socialization program for employees.

Answered: 1 week ago