Circle Area
Programming Basics · Python
TASK
Problem
Given circle radius `r`, use π = 3.14 and print the area `πr²`.
EXAMPLE
Example
5
78.5
LIMITS
Constraints
Physical and monetary quantities that cannot be negative are non-negative; the absolute value of other numeric inputs is at most 10^9.
LEARN
Theory for this problem
+
`input()` reads data entered by the user. The result of `input()` is initially a string. `float()` converts a numeric string into a number that may contain a decimal part. The `*` operator multiplies numbers. The `**` operator raises a number to a power. `print()` displays the program result. Print only what the problem statement requires.
**Connection to this task.** The `**` operator raises a number to a power. For example, `x ** 2` is the square and `x ** 3` is the cube. The expression `3.14 * r ** 2` shows how this idea is applied to the task data.
NEED HELP?
Hints
+
['Square the radius with `** 2` and multiply by 3.14.']
ANSWER
Solution
+
r = float(input()) result = 3.14 * r ** 2 print(result)