Write a python program in VSCode that does the following: line 1: import the math library (so you can access the constant math.pi) line 2: prompt the user with the message "What is the radius of your circle?", converting their input to a float and saving their answer in a variable called radius line 3: using the value stored in the variable radius, compute the circumference of the circle and store it in a variable called circumference. line 4: Now compute the area of the circle and store it in a variable called area. line 5 (or more): Output a sentence to the user giving the results. Sample output showing a run of the program: What is the radius of your circle, in centimeters? 3.4 A circle of radius 3.4 cm has circumference approximately 21.362830044410593 cm and area approximately 36.316811075498 cm^2
Write a python program in VSCode that does the following:
line 1: import the math library (so you can access the constant math.pi)
line 2: prompt the user with the message "What is the radius of your circle?", converting their input to a float and saving their answer in a variable called radius
line 3: using the value stored in the variable radius, compute the circumference of the circle and store it in a variable called circumference.
line 4: Now compute the area of the circle and store it in a variable called area.
line 5 (or more): Output a sentence to the user giving the results.
Sample output showing a run of the program:
What is the radius of your circle, in centimeters? 3.4 A circle of radius 3.4 cm has circumference approximately 21.362830044410593 cm and area approximately 36.316811075498 cm^2

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images









