medium
Refactor Python Code for Readability
Improve the structure and documentation of a code snippet.
📝 Содержимое промпта
Act as a senior software engineer. Review the following Python logic description: 'calculate the area of a circle given radius'. Write a clean Python function that implements this, adds type hinting, includes a descriptive docstring, and handles invalid input gracefully.