CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day02/circle.py
Views: 729
1
"""
2
输入半径计算圆的周长和面积
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-02-27
7
"""
8
import math
9
10
radius = float(input('请输入圆的半径: '))
11
perimeter = 2 * math.pi * radius
12
area = math.pi * radius * radius
13
print('周长: %.2f' % perimeter)
14
print('面积: %.2f' % area)
15
16