Created
November 5, 2025 19:32
-
-
Save Sanae6/60c6fe3d5f7c86e0787fa7c5801e273e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def main(): | |
| print("This program computes the volume and surface area of a sphere.") | |
| print() | |
| radius = int(input("Please enter the radius of the sphere: ")) | |
| print() | |
| def sphereArea(radius): | |
| return 4 * math.pi * radius ** 2 | |
| def sphereVolume(radius): | |
| return (4/3) * math.pi * radius ** 3 | |
| print(f"The sphere volume is {sphereVolume(radius):.02f} cubic units.") | |
| print(f"The sphere surface area is {sphereArea(radius):.02f} square units.") | |
| main() | |
| l = list(filter(lambda x: x % 2 == 0, range(20))) | |
| print(f"{l}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment