#!/usr/bin/python3
import Box, Pyramid, Sphere

shape = input("Enter a shape (Box, Pyramid, Sphere): ")

if (shape == "Box" or shape == "B" or shape == "box" or shape == "b"):
    b1 = Box.Cube()
    b1.bw = int(input("Box width: "))
    b1.bl = int(input("Box length: "))
    b1.bh = int(input("Box height: "))
    b1.volume()
    b1.surfaceArea()

elif (shape == "Pyramid" or shape == "P" or shape == "pyramid"
      or shape == "p"):
    p1 = Pyramid.Cypher()
    p1.pw = int(input("Pyramid width: "))
    p1.pl = int(input("Pyramid length: "))
    p1.ph = int(input("Pyramid height: "))
    p1.volume()
    p1.surfaceArea()

elif (shape == "Sphere" or shape == "S" or shape == "sphere" or shape == "s"):
    s1 = Sphere.Orb()
    s1.r = int(input("Radius: "))
    s1.volume()
    s1.surfaceArea()
Пример #2
0
import Box
import Pyramid
import Sphere

shape = input(
    "What kind of shape do you want?  Answer B for box, S for sphere, P for pyramid: "
)

if (shape == "B"):
    box1 = Box.Cube()
    box1.w = int(input("Box width: "))
    box1.l = int(input("Box length: "))
    box1.h = int(input("Box height: "))

    box1.volume()
    box1.SA()

elif (shape == "S"):
    sphere1 = Sphere.Pokeball()
    sphere1.r = int(input("Sphere radius: "))
    sphere1.volume()
    sphere1.SA()

elif (shape == "P"):
    pyramid1 = Pyramid.FidgetSpinner()
    pyramid1.pW = int(input("Pyramid width: "))
    pyramid1.pL = int(input("Pyramid length: "))
    pyramid1.pH = int(input("Pyramid height: "))
    pyramid1.volume()
    pyramid1.SA()