#Initialisation
v1=15.8 #voltage across r1
v2=12.3 #voltage across r2
r2=220 #resistance R2 in ohm
#Calculation
v=v1-v2 #voltage difference across the resistor
i=v/r2 #current in ampere
#Result
print'Current, I = %.1f mA'%(i*1000)
#Initialisation
i1=10; #current in amp
i3=3; #current in amp
#Calculation
i2=i1-i3 #current in amp
#Result
print'I2 = %d A'%i2
#Initialisation
E=12 #EMF in volt
v2=7 #volt
#Calculation
v1=E-v2 #volt
#Result
print'V1 = %d V'%v1
#Initialisation
i=3 #current in amp
r=50 #resistance in ohm
#Calculation
p=(i**2)*r #power in watt
#Result
print'P = %d W'%p
#Initialisation
r1=10 #resistance in ohm
r2=20 #resistance in ohm
r3=15 #resistance in ohm
r4=25 #resistance in ohm
#Calculation
r=r1+r2+r3+r4 #series resistance in ohm
#Result
print'R = %d ohm'%r
#Initialisation
r1=10 #resistance in ohm
r2=20 #resistance in ohm
#Calculation
r=(r1*r2)*(r1+r2)**-1 #parallel resistance in ohm
#Result
print'R = %.2f ohm'%r
#Initialisation
r1=200 #resistance in ohm
r2=300 #resistance in ohm
#Calculation
v=(10*r2)/(r1+r2) #resistance in ohm
#Result
print'V = %d V'%v
#Initialisation
r1=1*10**3 #resistance in ohm
r2=500 #resistance in ohm
v1=15 #voltage
v2=3 #voltage
#Calculation
v=v2+((v1-v2)*((r2)*(r1+r2)**-1)) #resistance in ohm
#Result
print'V = %d V'%v
#Initialisation
f=50 #frequency in herts
#Calculation
t=(1*f**-1) #time period
#Result
print'T = %d ms'%(t*10**3)