给定一个整数r
代表一个圆的半径。
你的任务是返回一个数组。
其中数组的第一个元素代表圆的周长,数组的第二个元素代表圆的面积。
PI = 3.14
样例
样例 1:
输入 : r = 2
输出 : [12.56, 12.56]
from typing import (
List,
)
class Solution:
"""
@param r: a Integer represent radius
@return: the circle's circumference nums[0] and area nums[1]
"""
def calculate(self, r: int) -> List[float]:
# write your code here
PI=3.14
z=r*2*PI
m=PI*r*r
c=(z,m)
return c