#Initialisation
c=100*10**-6 #capacitance in farad
r=100*10**3 #resistance in ohm
v=20 #volt
t=25 #time in seconds
e=2.71828 #mathematical constant
#Calculation
T=c*r #time in seconds
v1=v*(1-e**(-t*T**-1)) #volt
#Result
print'v = %.2f V'%v1
import math
#Initialisation
l=400*10**-3 #inductance in henry
i1=300 #current in milliamp
r=20 #resistance in ohm
v=15 #volt
t=25 #time in seconds
e=2.71828 #mathematical constant
#Calculation
T=l/r #time in seconds
i=(v*r**-1)*10**3 #current in amp
t=((math.log(i/(i-i1)))/(math.log(e)))*0.02 #expression to find time t
#Result
print't = %.1f mSec'%(t*10**3)
#Initialisation
c=20*10**-6 #capacitance in farad
r=10*10**3 #resistance in ohm
v=5 #volt
v2=10 #volt
#Calculation
T=c*r #time in seconds
#Result
print'v = %d - %d e^( -t/%.1f ) V'%(v2,v,T)