from __future__ import division
print "solution a : "
delta_q=1.67 # in c
delta_t=2 # in s
I=delta_q/delta_t
print "Current = %0.2f Amp"%I
print "solution b : "
N=5.22*10**18
N_q=(1.6*10**-19)*N
print "Number of electrons = %0.2f C"%N_q
from math import sqrt
M=63.5 # IN G
rho=8.95
v=M/rho
electrons=6.02*10**23
n=(electrons*10**6)/v
I=10 # in c/s
q=1.60*10**-19 # in c
A=3*10**-6 # in m2
vd=(I)/(n*q*A)
print "Solution a :"
print "The drift speed = %0.2e m/s="%vd
k_b=1.38*10**-23
T=293
m=9.11*10**-31
v_rms=sqrt((3*k_b*T)/m)
print "Drift speed of electron = %0.2e m/s"%v_rms
delta_v=120
I=6.4
R=(delta_v)/I
print "The resistance = %0.2f ohm"%R
from math import pi
r=0.321*10**-3
A=pi*(r*r)
print "Solution a : "
print "Area = %0.2e m**2"%A
rho=1.5*10**-6 # in ohm=m
l=rho/A
print"Resistance = %0.2f ohm/m"% l
print "solution b : "
Delta_v=10
I=(Delta_v)/l
print "The current = %0.2f Amps"%I
R=76.8
Ro=50
alpha=3.92*10**-3
t=(R-Ro)/(alpha*Ro)
T=t+20
print "Temperature = %0.2f C"%T
delta_v=50
R=8
I=(delta_v)/R
print "The current = %0.2f A"%I
P=I*I*R
print "Power = %0.2f Watt"%P
I=20 # in A
delta_v=120
p_bulb=75 # inwatt
p_total=I*delta_v
N=p_total/p_bulb
print "Number of bulbs = %d"%N
p=0.10 # in w
t=24 # in h
Energy=p*t
print "Energy = %0.2f kwh"%Energy
cost=Energy*0.12
print "Cost = %0.2f dollars"%cost