areaRect.py (420B)
1 print("This program calculates the area of a rectangle") 2 3 length = float(input("Type in the length : ")) 4 5 width = float(input("Type in the width : ")) 6 7 perimeter = (length * 2) + (width *2) 8 9 area = length * width 10 11 print("The area of the rectangle with a length of", length, "and a width of", width, "is", area) 12 print("The perimiter of the rectangle with a length of", length, "and a width of", width, "is", perimeter) 13 14