Python Online Compiler
Example: Python program to find the perimeter of a rectangle
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# Python program to find the perimeter of a rectangle print("Enter the length & width of the rectangle::\n") l, w, p = float(input()), float(input()), None # Calculate perimeter of rectangle p = 2 * (l + w) print("\nThe Perimeter of rectangle = ", p, "units")
5 7
Output
Clear
ADVERTISEMENTS