개발자 모드/파이썬(python)
파이썬 module 응용하기
인생은직구
2021. 5. 19. 18:47
728x90
test_module. py
PI = 3.141592
def number_input() :
output = input("숫자입력>")
return float(output)
def get_circumference(radius) :
return 2 * PI *radius
def get_circle_area(radius) :
return PI * radius * radius
main.py
import test_module as test
radius = test.number_input()
print(test.get_circumference(radius))
print(test.get_circle_area(radius))
결과
728x90