Skip to content

Instantly share code, notes, and snippets.

@Sanae6
Created November 5, 2025 19:32
Show Gist options
  • Select an option

  • Save Sanae6/60c6fe3d5f7c86e0787fa7c5801e273e to your computer and use it in GitHub Desktop.

Select an option

Save Sanae6/60c6fe3d5f7c86e0787fa7c5801e273e to your computer and use it in GitHub Desktop.
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