Perimeter of rectangle in Python

Source code :

width = 4
length = 5
perimeter = 2 * (width + length)
print(" Perimeter of rectangle is: %.2f" % perimeter)

Output :

Perimeter of rectangle is: 18.00

Algorithm :

  1. Enter width and length of rectangle
  2. Use the formula to calculate the Perimeter
  3. Finally print the result

Output :


                

Comments :