In [3]:

```
#given
m=0.04 #Mass of stone in kg
vi=25 #Initial velocity in m/s
vf=0 #Final velocity in m/s
yi=0 #Initial height in m
#Calculations
import math
Ui=(m*9.81*yi)
Ki=(1/2.0)*m*vi**2
Etotal=(Ui+Ki)
h=(Etotal/(m*9.8))
#when the stone is at (2/3)h, total energy is again same
v=math.sqrt((Etotal-(m*9.8*(2/3.0)*h))/((1/2.0)*m))
#Output
print"Maximum height it will reach is ",round(h,1),"m"
print"velocity when it is at the two-third of its maximum height is ",round(v,2),"m/s"
```

In [4]:

```
#given
m=0.5 #Mass of the sphere in kg
vi=100 #Initial velocity in m/s
vf=20 #Final velocity in m/s
#Calculations
h=(vi**2-vf**2)/(2.0*9.8)
PE=(m*9.8*h)
#Calculations
print"Potential energy of the sphere is ",PE,"J"
```

In [5]:

```
#given
m=0.5 #Mass of the block in kg
x=0.05 #Distance to which block is pulled in m
k=300 #Force constant of the spring in N/m
#Calculations
import math
U=(1/2.0)*k*x**2
v=x*math.sqrt(k/m)
#Output
print"Potential energy of the block when spring is in stretched position is ",U,"J"
print"Velocity of the block when it passes through the equilibrium position is ",round(v,2)," m/s"
```

In [7]:

```
#given
l=0.8 #Length of a simple pendulum in m
q=30 #Angle with the vertical through which the bob is released in degrees
q1=10 #Required angle in degrees
#Calculations
import math
v=math.sqrt(2*9.8*l*(math.cos(q1*3.14/180.0)-math.cos(q*3.14/180.0)))
#Output
print"Speed when the bob is at the angle of ",q1,"degrees with the vertical is ",round(v,2),"m/s"
```

In [8]:

```
#given
m=(9.1*10**-31) #Mass of the electron in kg
v=(3*10**8) #Velocity of light in m/s
c=(1.6*10**-19) #Charge of the electron in coloumbs
#Calculations
import math
Re=(m*v**2)/(c*10**6)
E=(Re/math.sqrt(1-0.9**2))
#Output
print"Rest energy of the electron is ",round(Re,3),"MeV"
print"Total energy is ",round(E,2),"MeV"
```