write a program python to take as input length and width from the user print its area of rectangle
Answers
Answer:
Explanation:
# Python Program to find Perimeter of a Rectangle using length and width
length = float(input('Please Enter the Length of a Triangle: '))
width = float(input('Please Enter the Width of a Triangle: '))
# calculate the perimeter
perimeter = 2 * (length + width)
print("Perimeter of a Rectangle using", length, "and", width, " = ", perimeter
Python Program:
# Python program to take input from the user
# and find the area of the rectangle.
# -------------------
# Equation A = h * b
# -------------------
# Ask the user to input the width of the rectangle.
width = float(input("Width of the triangle: "))
# Ask the user to input the length of the triangle.
length = float(input("Length of the triangle: "))
# Calculate the area by using the formula given
# at line 5
area = width * length
# Output the calculated area and end the program
print("The area of the triangle is", area)
Explanation:
- It is given in the program itself (check the comments)
Hope this helps you <3