Skip to content

Commit 97b6886

Browse files
authored
Create calculate_circumference_and_area.py
1 parent 4820826 commit 97b6886

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
"""
3+
@param r: a Integer represent radius
4+
@return: the circle's circumference nums[0] and area nums[1]
5+
"""
6+
def calculate(self, r):
7+
# write your code here
8+
pi = 3.14
9+
c = int(pi * 2.0 * r * 100.0)
10+
s = int(pi * r * r * 100.0)
11+
return [c / 100.0, s / 100.0]
12+
13+
easy: https://www.lintcode.com/problem/calculate-circumference-and-area

0 commit comments

Comments
 (0)