Python Online Compiler
Example: Python Program to Find Area of Rectangle using Function
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# Python Program to Find Area of Rectangle using Function def CalculateArea(): print("Enter the length & width of the rectangle::\n") l, w, a = float(input()), float(input()), None # It will calculate the area of the rectangle a = l * w print("\nArea of rectangle = ", a, "units") CalculateArea()
45 23
Output
Clear
ADVERTISEMENTS