Answered step by step
Verified Expert Solution
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
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.lStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started