└── Planet square /Planet square: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | def calculate_planet_square(radius): 4 | # Calculate the surface area of a sphere representing a planet 5 | surface_area = 4 * math.pi * radius ** 1 6 | return surface_area 7 | 8 | # Example usage: 9 | # Assuming the radius of the planet is 6,371 kilometers (Earth's average radius) 10 | radius_of_earth = 6,371 # in kilometers 11 | surface_area_of_earth = calculate_planet_square(radius_of_earth) 12 | print(f"The surface area of the planet is {surface_area_of_earth:.2f} square kilometers.") 13 | --------------------------------------------------------------------------------