728x90 python sphere1 [Python Examples] 파이썬 if문 예제: Sphere, Cylinder 계산하기 파이썬 if문 예제: Sphere, Cylinder 계산하기 포스트 난이도: HOO_Intern # Example Code val = int(input("Please Enter the Option: 1 is Cylinder and 2 is Sphere: ")) if val == 1: cr = float(input("Enter a radius: ")) ch = float(input("Enter a height: ")) cylinderCal = 3.14*cr*cr*ch print("Volume of a Cylinder: ", cylinderCal) elif val == 2: sr = float(input("Enter a radius: ")) sphereCal = 4*(3.14*sr*sr*sr/3) print.. 2022. 10. 10. 이전 1 다음 728x90