In [3]:

```
#calculate the heat added during the process
##Mass of oxygen present(in kg):
m=0.95;
##Initial temperatur(in K):
T1=300;
##Final temperature of oxygen(in K):
T2=900;
##Pressure of oxygen(in kPa):
p=150;
##Specific heat at constant pressure(in J/kg-K):
cp=909.4;
##Heat added during the process(in kJ):
Q12=m*cp*(T2-T1)
print'%s %.1f %s'%("Heat added during the process:",Q12/1000,"kJ")
```

In [4]:

```
##Mass of ball(in kg):
#calculate speed at which ball hits the ground and terminal speed
import math
m=0.2;
##Height fom which ball is dropped(in m):
y0=500.;
##Value of k:
k=2*10**-4;
##Accleration due to gravity(in m/sec**2):
g=9.81;
##speed and actual speed##
##Speed at which the ball hits the ground(in m/sec):
V=math.sqrt(m*g/k*(1-math.e**(2*k/m*(-y0))))
##Terminal speed(in m/sec):
Vt=math.sqrt(m*g/k)
##Ratio of actual speed to the terminal speed:
r=V/Vt;
print'%s %.1f %s'%("Speed at which the ball hits he ground:",V," m/sec")
print'%s %.3f %s'%("Ratio of actual speed to the terminal speed:",r,"")
```