-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculate-area.py
More file actions
34 lines (26 loc) · 1.35 KB
/
Copy pathcalculate-area.py
File metadata and controls
34 lines (26 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Write a Python program which accepts multiple integer for calculating area of some geometrical shapes like Circle, Square, rectangle etc.
Program code:
radius = int(input("Enter radius: "))
side_square = int(input("Enter side value of square: "))
side1_rec, side2_rec = int(input("Enter first side value of reactangle: ")), int(input("Enter second side value of reactangle: "))
print("\n")
print("Radius of circle is: "+str(radius), end = "\n")
print("Side of square is: "+str(side_square), end = "\n")
print("Both sides of rectangle are: "+str(side1_rec)+" and "+ str(side2_rec),end = "\n")
print("Area of circle is == 3.141 * radius * radius -> 3.141*(radius**2) \n ===>", (radius**2)*3.141, end = "\n")
print("Area of square is == side * side -> side_square**2\n ===> ", side_square**2, end = "\n")
print("Area of rectangle is == length * breadth -> side1_rec * side2_rec \n ===> ", side1_rec*side2_rec)
Output of the above code is:
Enter radius: 7
Enter side value of square: 12
Enter first side value of reactangle: 10
Enter second side value of reactangle: 16
Radius of circle is: 7
Side of square is: 12
Both sides of rectangle are: 10 and 16
Area of circle is == 3.141 * radius * radius -> 3.141*(radius**2)
===> 153.909
Area of square is == side * side -> side_square**2
===> 144
Area of rectangle is == length * breadth -> side1_rec * side2_rec
===> 160