Q. Write a program to calculate the following using modules:


(a) Energy = m * g * h

(b) distance = ut + + 1/2at2

(c) Speed = distance / time


Answer =

Module name depend on user’s mind.

Program in module is:-
def energy (m, g, h) :
    return m * g * h
def distance (u, a, t) :
    return (u * t) + (1 / 2 * a * t **2)
def speed (d, t) :
    return (d / t)


Output :-

>>> import Path_Walla
>>> energy (60, 9.8, 21)
12348.0
>>> distance (18, 5.2, 4)
113.6
>>> speed (300, 5)
60.0
>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post