Question: Task#1: Module Create a module called 'my_module', and in this module define functions to add, subtract, divide , and multiply two numbers that are passed
Task#1: Module
Create a module called 'my_module', and in this module define functions to add, subtract, divide , and multiply two numbers that are passed as parameters. You can name these functions as addNums, subNums, multNums, and divNums respectively.
Import the module, and invoke the individual functions from my_module and display the result. For instance:
add_result = my_modules.addNums(10,20)
print('addition result:', add_result)
Task#2: Class
1.Write a class called 'Circle', having radius as its property (attribute). Write the following methods inside the class:
__init__, computeDiameter, computeCircumeference, and computeArea.
In __init__ method initialize the radius of the circle.
computeDiameter method should compute and print the diameter of circle.
computeCircumeference method should compute and print the circumference of circle.
computeArea method should compute and print the area of circle.
2.Create at-least two objects (instances) of Circle class, and compute their diameter, circumference, and area using the methods (operations) from the class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
