Question: This is a python assignment. May I know whats wrong? Thanks! Print the circumference and area of the circle after user inputs the radius of


This is a python assignment. May I know whats wrong? Thanks!
Print the circumference and area of the circle after user inputs the radius of a circle. Do not use any input prompt. User may input any floating point number as the radius. Print the circumference and area up to 2 decimal places as shown in the example. (Note about rounding: In Lecture 2 we mentioned issues related to problems of accuracy of representation of floating point numbers, and specific rounding method by Python. However, for simplicity the test cases of this question DO NOT require you to solve such issues.) For example: Test Input Result 1 3 Circumference: 18.85 Area: 28.27 Answer: (penalty regime: 10, 20, ... %) Reset answer * 1 from math import pi 2 # You may use the variable pi in your code 3 x = float() 4 y = 2 * pi 5 z = pi (x ** 2) 6 print("Circumference: {: .2f}".format(y)) 7 Jprint("Area: {:.2f}".format(z)) Test Input Expected Got x 1 3 Circumference: 18.85- Area: 28.27 Circumference: 0.00 x Area: 0.00 x 2 2.2 Circumference: 13.82- Area: 15.21 Circumference: 0.00- x Area: 0.00 x 3 10 Circumference: 62.83- Area: 314.16 Circumference: 0.00- X Area: 0.00 X 4 72 Circumference: 452.39- Circumference: 0.00- Area: 16286.02 Area: 0.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
