Computer Science, asked by shazebsiddiqui84, 1 month ago

Write a python program to calculate the area of rectangle by using function.

Answers

Answered by selvarajshasti
2

Answer:

ok your answer

Explained:

w = float ( input ( 'Please Enter the Width of a Rectangle: ' )) h = float ( input ( 'Please Enter the Height of a Rectangle: ' ))

# calculate the area. Area = w * h.

# calculate the Perimeter. Perimeter = 2 * (w + h)

print ( "\n Area of a Rectangle is: %.2f" % Area) print ( " Perimeter of Rectangle is: %.2f" % Perimeter)

mark me branliest

Answered by Yugant1913
10

Follow the below steps and Write a Program to find the Area of a Rectangle and Perimeter of a Rectangle in Python:

Allow the User to input the Width and Height of a rectangle.

Next, we are calculating the area as per the formula Area = width * height.

In the next line, We are calculating the Perimeter of a rectangle Perimeter = 2 * (width + height).

Print the Perimeter and Area of a rectangle.

____________input _______________

# Write a Program to find the Area of a Rectangle and

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Python

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the area

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the areaArea = w * h

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the areaArea = w * h# calculate the Perimeter

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the areaArea = w * h# calculate the PerimeterPerimeter = 2 * (w + h)

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the areaArea = w * h# calculate the PerimeterPerimeter = 2 * (w + h)print("\n Area of a Rectangle is: %.2f" %Area)

# Write a Program to find the Area of a Rectangle and # Perimeter of a Rectangle in Pythonw = float(input('Please Enter the Width of a Rectangle: '))h = float(input('Please Enter the Height of a Rectangle: '))# calculate the areaArea = w * h# calculate the PerimeterPerimeter = 2 * (w + h)print("\n Area of a Rectangle is: %.2f" %Area)print(" Perimeter of Rectangle is: %.2f" %Perimeter)

_____________output _________

After executing the python program, the output will be:

Please Enter the Width of a Rectangle: 10

Please Enter the Width of a Rectangle: 10Please Enter the Height of a Rectangle: 5

Please Enter the Width of a Rectangle: 10Please Enter the Height of a Rectangle: 5Area of a Rectangle is: 50.00

Please Enter the Width of a Rectangle: 10Please Enter the Height of a Rectangle: 5Area of a Rectangle is: 50.00Perimeter of Rectangle is: 30.00

Similar questions