Example #1
0
def main():
    circle(5)
    square(5)
    rectangle(10, 2)
    traingle(5, 4)
    """c(5)
Example #2
0
import area

PEOPLE_AT_CONCERT_PER_SQUARE_METER = 2
# numero de pessoas por metro quadrado em média
FIELD_LENGTH = 240  # em metros
FIELD_WIDTH = 45  # em metros
PEOPLE_AT_CONCERT = area.rectangle(FIELD_LENGTH, FIELD_WIDTH)
# PEOPLE_AT_CONCERT_PER_SQUARE_METER

print("Estão presentes no show aproximadamente", PEOPLE_AT_CONCERT, "pessoas")
Example #3
0
def test_module():

    print("***** Geometry Calculator *****\n", '### menu ###\n',
          'p - perimeter\n', 'a - area\n', 'v - volume\n', 'b - busbar\n',
          'pytha - pythagorean theorem\n')

    user_menu = str(input())

    if user_menu == 'p':

        import perimeter as p

        print(
            "### perimeter - shape ###\nYou can type\nsquare, rectangle, circle, triangle, parrelleogram, circular sector, trapezoid\n"
        )

        shape = str(input())

        if shape == 'square':

            print("type - s")
            s = int(input())
            print(p.square(s))

        elif shape == 'rectangle':

            print("type - a, b")
            a = int(input())
            b = int(input())
            print(p.rectangle(a, b))

        elif shape == 'circle':

            print("type - r")
            r = int(input())
            print(p.circle(r))

        elif shape == 'triangle':

            print("type - a, b, c")
            a = int(input())
            b = int(input())
            c = int(input())
            print(p.triangle(a, b, c))

        elif shape == 'parallelogram':

            print("type - a, b")
            a = int(input())
            b = int(input())
            print(p.parallelogram(a, b))

        elif shape == 'circular sector':

            print("type - r, seta")
            r = int(input())
            seta = int(input())
            print(p.circular_sector(r, seta))

        elif shape == 'trapezoid':

            print("type - a, b, c, d")
            a = int(input())
            b = int(input())
            c = int(input())
            d = int(input())
            print(p.trapezoid(a, b, c, d))

    elif user_menu == 'a':

        import area as ar

        print(
            "### area - shape ###\nYou can type\nsquare, rectangle, circle, triangle, parallelogram, circular sector, circular ring, trapezoid, rectangular box, right circular cone, cube, cylinder\n"
        )

        shape = str(input())

        if shape == 'square':

            print("type - s")
            s = int(input())
            print(ar.square(s))

        elif shape == 'rectangle':

            print("type - a, b")
            a = int(input())
            b = int(input())
            print(ar.rectangle(a, b))

        elif shape == 'circle':

            print("type - r")
            r = int(input())
            print(ar.circle(r))

        elif shape == 'triangle':

            print("type - b, h")
            b = int(input())
            h = int(input())
            print(ar.triangle(b, h))

        elif shape == 'parallelogram':

            print("type - b, h")
            b = int(input())
            h = int(input())
            print(ar.parallelogram(b, h))

        elif shape == 'circular sector':

            print("type - r, seta")
            r = int(input())
            seta = int(input())
            print(ar.circular_sector(r, seta))

        elif shape == 'circular ring':

            print("type - R, r")
            R = int(input())
            r = int(input())
            print(ar.circular_ring(R, r))

        elif shape == 'trapezoid':

            print("type - h, a, b")
            h = int(input())
            a = int(input())
            b = int(input())
            print(ar.trapezoid(h, a, b))

        elif shape == 'rectangular box':

            print("type - a, b, c")
            a = int(input())
            b = int(input())
            c = int(input())
            print(ar.rectangular_box(a, b, c))

        elif shape == 'right circular cone':

            print("type - r, s")
            r = int(input())
            s = int(input())
            print(ar.right_circular_cone(r, s))

        elif shape == 'cube':

            print("type - l")
            l = int(input())
            print(ar.cube(l))

        elif shape == 'cylinder':

            print("type - r, h")
            r = int(input())
            h = int(input())
            print(ar.cylinder(r, h))

    elif user_menu == 'v':

        import volume as v

        print(
            "### volume - shape ###\nYou can type\nsphere, rectangular box, right circular cone, cube, cylinder, frustum of a cone\n"
        )

        shape = str(input())

        if shape == 'sphere':

            print("type - r")
            r = int(input())
            print(v.sphere(r))

        elif shape == 'rectangular box':

            print("type - a, b, c")
            a = int(input())
            b = int(input())
            c = int(input())
            print(v.rectangular_box(a, b, c))

        elif shape == 'right circular cone':

            print("type - r, h")
            r = int(input())
            h = int(input())
            print(v.right_circular_cone(r, h))

        elif shape == 'cube':

            print("type - l")
            l = int(input())
            print(v.cube(l))

        elif shape == 'cylinder':

            print("type - r, h")
            r = int(input())
            h = int(input())
            print(v.cyliner(r, h))

        elif shape == 'frustum of a cone':

            print("type - r, R, h")
            r = int(input())
            R = int(input())
            h = int(input())
            print(v.frustum_of_a_cone(r, R, h))

    elif user_menu == 'pytha':

        import pythagorean as pytha

        print(
            "### pythagorean - shape ###\nYou can type\npythagorean theorem\n")

        shape = str(input())

        if shape == 'pythagorean theorem':

            print("type - a, b")
            a = int(input())
            b = int(input())
            print(pytha.pythagorean_theorem(a, b))

    elif user_menu == 'b':

        import busbar as bb

        print("### busbar - shape ###\nYou can type\nright circular cone\n")

        shape = str(input())

        if shape == 'right circular cone':

            print("type - r, h")
            r = int(input())
            h = int(input())
            print(bb.right_circular_cone(r, h))
import area


PEOPLE_AT_CONCERT_PER_SQUARE_METER = 2  # numero de pessoas por metro quadrado em média
FIELD_LENGTH = 240  # em metros
FIELD_WIDTH = 45  # em metros
PEOPLE_AT_CONCERT = area.rectangle(FIELD_LENGTH, FIELD_WIDTH) // PEOPLE_AT_CONCERT_PER_SQUARE_METER


print("Estão presentes no show aproximadamente", PEOPLE_AT_CONCERT, "pessoas")
import area


PEOPLE_AT_CONCERT_PER_SQUARE_METER = (
    2  # numero de pessoas por metro quadrado em média
)
FIELD_LENGTH = 240  # em metros
FIELD_WIDTH = 45  # em metros
PEOPLE_AT_CONCERT = (
    area.rectangle(FIELD_LENGTH, FIELD_WIDTH)
    // PEOPLE_AT_CONCERT_PER_SQUARE_METER
)


print("Estão presentes no show aproximadamente", PEOPLE_AT_CONCERT, "pessoas")
Example #6
0
from area import square,rectangle,triangle,circle
square(10)
rectangle(2,5)
circle(4)
triangle(2,4)

list1=[101,981,'abcd','xyz','m','aman']
list2=['aman','shekhar',100.45,98.2]
list3=[101,981,'abcd','xyz','m',6]
print cmp(list1,list2)
print cmp(list2,list1)
Example #7
0
import calculator
from area import square, rectangle

calculator.add(10, 20)
calculator.multiply(5, 16)
square(10)
rectangle(8, 4)
import area

PEOPLE_PER_SQUARE = 2
FIELD_LENGTH = 240
FIELD_WIDTH = 45
PEOPLE_AT_AREA_TOTAL = area.rectangle(FIELD_LENGTH,
                                      FIELD_WIDTH) // PEOPLE_PER_SQUARE

print("O número aproximadas de pessoas no espaço é de:", PEOPLE_AT_AREA_TOTAL)
Example #9
0
    )

    shape = str(input())

    if shape == 'square':

        print("type - a : width / b : height")
        s = int(input("s :"))
        print(ar.square(s))

    elif shape == 'rectangle':

        print("type - a : width / b : height")
        a = int(input("a :"))
        b = int(input("b :"))
        print(ar.rectangle(a, b))

    elif shape == 'circle':

        print("type - r : radius")
        r = int(input("r :"))
        print(ar.circle(r))

    elif shape == 'triangle':

        print("type - b : base / h : height")
        b = int(input("b :"))
        h = int(input("h :"))
        print(ar.triangle(b, h))

    elif shape == 'parallelogram':
Example #10
0
import area

print('Area of rectangle of 2:1 is ', end='')
print(area.rectangle(2, 1))

print('Area of Circle of radius 3 is ', end='')
print(area.circle(3))

print('Area of triangle with base 4 and height 5 is ', end='')
print(area.triangle(4, 5))

print('Surface area of sphere with radius 7 is ', end='')
print(area.sphere(7))
Example #11
0
 def test_area(self):
     self.assertEqual(triangle(3,2),3.0)
     self.assertEqual(rectangle(2,3),6.0)
     self.assertEqual(circle(5),78.53981633974483)
     self.assertEqual(square(4),16)