0% found this document useful (0 votes)
10 views1 page

Practical-03 Exercise 5

This document provides a practical exercise to write a program that calculates the area and perimeter of a square based on user input for the side length. The area is calculated using the formula s^2, while the perimeter is calculated using 4s. The program outputs the results formatted to two decimal places.

Uploaded by

Soham Pandit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Practical-03 Exercise 5

This document provides a practical exercise to write a program that calculates the area and perimeter of a square based on user input for the side length. The area is calculated using the formula s^2, while the perimeter is calculated using 4s. The program outputs the results formatted to two decimal places.

Uploaded by

Soham Pandit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical No: 03

Exercise 5: Write a program to calculate area and perimeter of the


square.

side = float(input("Enter the side length of the square: "))


area = side**2 #Area=s^2
perimeter = 4 * side #Perimeter=4s
print(f"The area of the square is {area:.2f}")
print(f"The perimeter of the square is {perimeter:.2f}")

Output of Code:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy