Radius of given circle r, Find the area of a circle .
Input contains an integer r, Represents the radius of a circle .
Output one line , Contains a real number , Round to decimal 7 position , Represents the area of a circle .
explain : In the subject , Input is an integer , But the output is a real number .
On the problem of real number output , Please be sure to see the requirements of real output , For example, it is required to keep the decimal point after this question 7 position , Your program must be strict with the output 7 Decimal place , It's not good to output too many or too few decimal places , Would be considered wrong .
If there is no special explanation for the problem of real number output , Rounding is done by rounding .
import math
r = int(input())
s = math.pi * r ** 2
# print("%.7f" % s)
print("{:.7f}" .format(s))
1. have access to format() Function to specify output precision , You can also use a format string
formate For detailed usage of the function, please refer to the following article
Python Format output format function
For formatted output, refer to the following article
Python Formatted string ( Format output )
2. In mathematics pi need import math