#importing modules
import math
from __future__ import division
#Variable declaration
h = 6.63*10**-34; #planck's constant(J)
c = 3*10**8; #velocity of light(m/s)
lamda = 6328; #wavelength of laser(angstrom)
ev = 6.24*10**18; #conversion factor from J to eV
#Calculation
lamda = lamda*10**-10; #wavelength of laser(m)
E = h*c/lamda; #energy of photon(J)
Eev = E*ev; #energy of photon(eV)
Eev = math.ceil(Eev*10**3)/10**3; #rounding off to 3 decimals
#Result
print "energy of photon is",round(E/1e-19,2),"*10**-19 J or",Eev,"eV"
#importing modules
import math
from __future__ import division
#Variable declaration
lamda = 6730; #wavelength of laser(angstrom)
p = 1; #output power(mW)
h = 6.63*10**-34; #planck's constant(J)
c = 3*10**8; #velocity of light(m/s)
#Calculation
p = p*10**-3; #output power(W)
lamda = lamda*10**-10; #wavelength of laser(m)
n = p*lamda/(h*c); #number of photons(per sec)
#Result
print "number of photons emitted is",round(n/1e+15,2),"*10**15 per sec"
print "answer given in the book is wrong"
#importing modules
import math
from __future__ import division
#Variable declaration
l = 3*10**-2; #coherence length for sodium light(m)
lamda = 5893; #wavelength(angstrom)
c = 3*10**8; #velocity of light(m/s)
#Calculation
lamda = lamda*10**-10; #wavelength(m)
n = l/lamda; #number of oscillations
tc = l/c; #coherence time(s)
#Result
print "number of oscillations is",round(n)
print "the coherence time is",tc,"s"