#Variable declaration
E3p=-3#in ev
E3s=-5.1#in ev
E=E3p-E3s
E_Joule=E*1.6*10**-19#in Joule
h=6.6*10**-34#in J-s
c=3*10**8#in m/s
#calculations&Results
#Part a
lamda=(h*c)/E_Joule
print "The wavelength is %.1e m"%lamda
#Part b
d_lamda=(h*c*E_Joule)/(E_Joule)**2
print "The magnitude of seperation is %.1e m"%d_lamda
#Answer given in book for part b is wrong
#Variable declaration
a=1.0*(1+1)
x=a+a-a
y=2*a
g=1+(x/y)
u=9.3*10**-24#amp-m2
B=1./10#in Tesla
#calculations
delta_E=u*B*g
#Result
print "The displace energy is %.1e joule or %.1e eV"%(delta_E,(delta_E*6.24*10**18))
#Variable declaration
h=6.6*10**-34#in J-s
v=1*10**10#per sec
ub=9.3*10**-24#in amp-m2
#calculations
B=(h*v)/(2*ub)
#Result
print "The Magentic energy is %.1e Tesla"%B