I have a python programming question  Create a package called geometry. Inside that package create two modules: rectangle.py and triangle.py. Also create an empty file with name __init__.py in the geometry package.Inside rectangle.py define three functions:1. rectArea(): this function takes two parameters length and width of a rectangle, calculates and returns the area.2. rectCircumference(): this function takes two parameters length and width of a rectangle, calculates and returns the circumference.3. isSquare(): this function takes two parameters length and width of a rectangle and returns true if they are equal otherwise returns false.Inside triangle.py define two functions:1. triArea(): this function takes two parameters base and height of a triangle, calculates and returns the area.2. triCircumference(): this function takes three parameters, three sides of a triangle and returns the circumference.Create main.py in the same directory as the geometry package. Import your modules. Prompt the user to select an operation among 5 different functions. Once the user enters the proper selection, ask the user to input the necessary arguments. Call the proper functions from your modules and print the result. Continue until the user enters a sentinel value such as -1.Sample output:Enter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:1Enter length:4Enter width:6Area= 24Enter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:2Enter length:2Enter width:3Circumference= 10Enter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:3Enter length:4Enter width:4It is a squareEnter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:4Enter base:7Enter height:8Area= 28.0Enter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:5Enter side1:2Enter side2:5Enter side3:7Circumference= 14Enter selection,1 for Area of rectangle2 for Circumference of rectangle3 for Check if square4 for Area of triangle5 for Circumference of Triangle-1 to exit:-1Program ended

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I have a python programming question 

Create a package called geometry. Inside that package create two modules: rectangle.py and triangle.py. Also create an empty file with name __init__.py in the geometry package.

Inside rectangle.py define three functions:
1. rectArea(): this function takes two parameters length and width of a rectangle, calculates and returns the area.
2. rectCircumference(): this function takes two parameters length and width of a rectangle, calculates and returns the circumference.
3. isSquare(): this function takes two parameters length and width of a rectangle and returns true if they are equal otherwise returns false.
Inside triangle.py define two functions:
1. triArea(): this function takes two parameters base and height of a triangle, calculates and returns the area.
2. triCircumference(): this function takes three parameters, three sides of a triangle and returns the circumference.

Create main.py in the same directory as the geometry package. Import your modules. Prompt the user to select an operation among 5 different functions. Once the user enters the proper selection, ask the user to input the necessary arguments. Call the proper functions from your modules and print the result. Continue until the user enters a sentinel value such as -1.

Sample output:

Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
1
Enter length:4
Enter width:6
Area= 24
Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
2
Enter length:2
Enter width:3
Circumference= 10
Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
3
Enter length:4
Enter width:4
It is a square
Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
4
Enter base:7
Enter height:8
Area= 28.0
Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
5
Enter side1:2
Enter side2:5
Enter side3:7
Circumference= 14
Enter selection,
1 for Area of rectangle
2 for Circumference of rectangle
3 for Check if square
4 for Area of triangle
5 for Circumference of Triangle
-1 to exit:
-1
Program ended

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY