Tuesday, May 7, 2024

📑 Managed Attributes

📑 Task

1) Describe the object stored in variable c1
2) Create class attributes 'area' and 'circumference' and
convert them into properties or managed attributes

📑 Answer

1) The object stored in the variable c1 is an instance of the Circle class
It represents a circle with a radius derived
from the given diameter and a specified unit of measurement
2) Now the Circle class provides the ability to easily calculate
area and circumference for its instances

📑 Decorated Built-in Functions

📑 Task

1) What effect for the built-in function will we see after running this code?
2) Suggest a similar technique for rounding the results of calculations
of built-in mathematical functions, and also
provide a way to revert to the original built-in function

📑 Answer

1) The decorated print function now prints each argument
with a space at the end and flushes the output,
pausing for 1 second after printing each argument
2)