Friday, July 17, 2020

Python Program for 8th standard Mathematics kids calculates Volume of a 3D object of your choice.[FREE CODE]

*****
This easy and simple Python code for 8th standard Mathematics kids calculates Volume of a 3D object of your choice. Its real fun and learning,Try it out!!
*****

while True:
    a = "cube"
    b = "cuboid"
    c = "cylinder"
    s = "sphere"
    p = "pyramid"
    d = input("""  What do U want to calculate? 
                   Type CUBE for volume of a CUBE
                   Type CUBOID for Volume of CUBOID
                   Type CYLINDER for Volume of CYLINDER
                   Type SPHERE for Volume of SPHERE
                   Type PYRAMID for Volume of  a PYRAMID : """)
    if a.lower() == d.lower():
        e = int(input("Enter edge of cube : "))
        print("*******Volume of cube is",round(e ** 3))
    elif b.lower() == d.lower():
        f = int(input("Enter length  of Cuboid: "))
        g = int(input("Enter base of Cuboid: "))
        h = int(input("Enter height of Cuboid : "))
        print("Volume of Cuboid is",round(f * g * h))
    elif c.lower() == d.lower():
        i = int(input("Enter radius of Cylinder: "))
        j = int(input("Enter height of Cylinder : "))
        print("Volume of Cylinder is",round(22/7 * (i) ** 2 * j))
    elif s.lower() == d.lower():
        k = int(input("Enter radius of Sphere : "))
        print("The Volume of Sphere is",round(4/3 * 22/7 * (k) ** 3))
    elif p.lower() == d.lower():
        l = int(input("Enter length of Pyramid : "))
        m = int(input("Enter width of Pyramid : "))
        n = int(input("Enter height of Pyramid : "))
        print("Volume of Pyramid is",round((l * m * n)/3))
    else:
        print("Enter Valid Entry.....NERD")