1. Rectangle calculator
Write code Easy ✓ CompletedUsing the given width and height, create three variables:
area— width times height,perimeter— the distance all the way round (2 × width + 2 × height),is_square—Trueif width and height are equal, otherwiseFalse. Use a comparison operator rather than typing True or False.
Then print all three.
width = 7
height = 4
# create area, perimeter and is_squarewidth = 7
height = 4
area = width * height
perimeter = 2 * width + 2 * height
is_square = width == height
print(area, perimeter, is_square)