Write a python function that returns a dictionary with the area and perimeter of a rectangle


Topic: Write a python function that returns a dictionary with the area and perimeter of a rectangle

Solution

def calculate_rect_properties(width, height):
   return {
      'perimeter': 2 * (width + height),
      'area': width * height
   }



List all Python Programs