from __future__ import division
#Cal of Equivalent resistance
#Initialization
#Resistors connected in parallel in Ohm
R1=5
R2=10
from decimal import *
#Calculation
R=(R1*R2)/(R1+R2)
print "R=",round(R,2),"ohm"
from __future__ import division
#Cal of Equivalent resistance
#Initialization
#Resistors connected in parallel
R1=R2=R3=5 #in Ohm
#Calculation
R=1/((1/R1)+(1/R2)+(1/R3))
print "R=",round(R,2),"Ohm"
from __future__ import division
#Cal of resistance(R2) to be reduced
#Initialization
#Resistance in Ohm
R1=50
R=20
R2=(R1*R)/(R1-R)
print "R2=",round(R2,1),"Ohm"
from __future__ import division
#Cal of Power in series and parallel
#Initialization
R1=R2=240 # in Ohm
V=120 #voltage in volts
#(a)Power in series
R=R1+R2 #Equivalent resistance
I=V/R #Current in the circuit
P=(I**2)*R1 #Power dissipated
print "(a)P=",int(P),"W"
#(b)POwer in Parallel
P=(V**2)/R1
print "(b)P=",int(P),"W"
print "The bulbs will be higher when connected in parallel."
from __future__ import division
#Cal of resistor to be connected with the meter
#Initialization
I_meter=0.001 #meter current in ampere
I_shunt=0.999 #Shunt current in ampere
R_meter=40 #Shunt resistance in Ohm
R_shunt=(I_meter/I_shunt)*R_meter
print "R_shunt=",round(R_shunt,2),"Ohm"
print "A",R_shunt,"Ohm resistor in parallel with the meter will permit it to measure currents from 0 to 1 A"