방통대/파이썬
4-5 실습 - 변수 사용
꿈꾸는 몽나
2024. 3. 14. 23:48
728x90
https://colab.research.google.com/
Google Colaboratory
colab.research.google.com
코드 입력)
#반지름, 높이 값 할당
rad = 20
hei = 30
#부피출력
print(1 / 3 * 3.14 * rad ** 2 * hei )
#겉넓이출력
print(3.14 * rad ** 2 + 3.14 * rad * hei)
출력)
12559.999999999998
3140.0
728x90