Gangle. Get the input of height
Write a program in Python to find area and perimeter of a square with length of
side 5 cm.
Answers
Answered by
0
Language:
Python
Program:
side=float(input("Enter the side length:"))
print(f'Perimeter = {side*4}')
print(f'Area = {side*side}')
Output:
Enter the side length:5
Perimeter = 20
Area = 25
Explanation:
- Takes side as input
- Side*4 multiplies side with 4 which is the perimeter of a square, area follows the same logic,
- Used f string to make control spaces between output.
Similar questions