Answer:
Follows are the code to this question:
import math as x #import math package
#option a
radius = 10#defining radius variable
print("radius = ", radius)#print radius value
realA = x.pi * radius * radius#calculate the area in realA variable
print("\\realA = ", realA)#print realA value
#option b
a1 = 3.1 * radius * radius#calculate first area in a1 variable
print("Area 1= ", a1)#print Area
print("Percentage difference= ", ((realA - a1)/realA) * 100) #print difference
a2 = 3.14 * radius * radius#calculate first area in a2 variable
print("Area 2= ", a2)#print Area
print("Percentage difference= ", ((realA - a2)/realA) * 100)#print difference
a3 = 3.141 * radius * radius#calculate first area in a2 variable print("Area 3= ", a3)#print Area
print("Percentage difference= ", ((realA - a3)/realA) * 100) #print difference
Output:
please find the attached file.
Step-by-step explanation:
In the given Python code, firstly we import the math package after importing the package a "radius" variable is defined, that holds a value 10, in the next step, a "realA" variable is defined that calculate the area value.
In the next step, the "a1, a2, and a3" variable is used, which holds three values, that is "3.1, 3.14, and 3.141", and use the print method to print its percentage difference value.