Ви плануєте облаштувати круглу клумбу у своєму дворі. Потрібно обчислити площу клумби та довжину кола, для придбання матеріалів для облаштування.
Користувач вводить діаметр майбутньої клумби.
Створити програму, що буде обчислювати та виводити на екран площу та довжину кола.
У програмі використати модуль math
число пі - pi функція

Ответы

Ответ дал: ratytsalu
1

import math

# Read the diameter of the circular flowerbed

diameter = float(input("Enter the diameter of the circular flowerbed: "))

# Calculate the radius of the flowerbed

radius = diameter/2

# Calculate the area of the flowerbed

area = math.pi * radius**2

# Calculate the circumference of the flowerbed

circumference = 2 * math.pi * radius

# Print the area and the circumference

print("The area of the circular flowerbed is:", area)

print("The circumference of the circular flowerbed is:", circumference)

Вас заинтересует