How to Make Area Calculator in Python | Python Tutorial | Area Calculator

Publié le: 11 octobre 2020
sur la chaîne: Local Python
1,348
25

It is a simple code to make shape area calculator : square, rectangle, triangle, circle..you can add more on these : The code used :
#AreaCalculator in Python


def square():
sidesq = float(input("Side of the Square :"))
areasq = sidesq * sidesq
print("Area of the Square : ", areasq)


def rectangle():
length = float(input("Input the length of the Rectangle: "))
breadth =float(input("Input the breadth of the Rectangle: "))
arearectangle = length * breadth
print("Area of the Rectangle : ", arearectangle)



def triangle():
height = float(input("Input the Value of the Height:"))
base = float(input("Input the base of the triangle :"))
areatriangle = 0.5 * height * base

print("Area of the Triangle : ", areatriangle)



def circle():
radius = float(input("Input the Radius of The Circle :"))
areacircle = 3.14 * radius * radius
print("Area of the Circle : ", areacircle)


print(" [ square, circle, triangle, rectangle or interest] ")
choice = str(input("What you want to Find?"))

if choice == "square":
square()

elif choice == "rectangle":
rectangle()

elif choice == "triangle":
triangle()

else:
circle()


Sur cette page du site, vous pouvez voir la vidéo en ligne How to Make Area Calculator in Python | Python Tutorial | Area Calculator durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Local Python 11 octobre 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,348 fois et il a aimé 25 téléspectateurs. Bon visionnage!