Simple Python program to calculate the area of a rectangle by taking base and height input from the user and displaying the result with two decimal precision.
# Program to calculate the area of a rectangle
# Ask the user to enter the base of the rectangle
base = float(input("Enter the base of the rectangle: "))
# Ask the user to enter the height of the rectangle
altezza = float(input("Enter the height of the rectangle: "))
# Calculate the area by multiplying base by height
area = base * altezza
# Print the result with two decimal places
print(f"The area of the rectangle is: {area:.2f}")Python 3.x installed
Keyboard INPUT for base and height
Console OUTPUT