In [1]:

```
import math
#Variables
R1 = 220 #Resistance (in ohm)
R2 = 470 #Resistance (in ohm)
R3 = 560 #Resistance (in ohm)
R4 = 910 #Resistance (in ohm)
#Calculation
R = R1 + R2 + R3 + R4 #Net Resistance (in ohm)
#Result
print "Total resistance of circuit is ",R," ohm."
```

In [2]:

```
import math
#Variables
R1 = 4 #Resistance (in kilo-ohm)
R2 = 6 #Resistance (in kilo-ohm)
R3 = 2 #Resistance (in kilo-ohm)
#Calculation
R = R1 + R2 + R3 #Equivalent Resistance(in kilo-ohm)
#Result
print "Equivalent Resistance is ",R," kilo-ohm."
```

In [3]:

```
import math
#Variables
R1 = 250 #Resistance (in ohm)
R3 = 375 #Resistance (in ohm)
I = 50 * 10**-3 #Current (in Ampere)
V = 40 #Voltage (in volts)
#Calculation
R = V/I #Equivalent Resistance (in ohm)
R2 = R - (R1 + R3) #Resistance R2 (in ohm)
#Result
print "The Total Resistance is ",R," ohm.\nThe value of R2 is ",R2," ohm."
```

In [4]:

```
import math
#Variables
I = 250 * 10**-3 #Current (in Ampere)
R = 1.5 * 10**3 #Resistance (in ohm)
#Calculation
Vs = I * R #Source voltage (in volts)
I1 = 0.75 * I #New current (in Ampere)
R1 = Vs / I1 #New Resistance (in ohm)
R2 = R1 - R #Resistance to be added (in ohm)
#Result
print R2," ohm Resistance must be added in order to accomplish the reduction in current."
```

In [5]:

```
import math
#Variables
R1 = 2.2 #Resistance (in kilo-ohm)
R2 = 1 #Resistance (in kilo-ohm)
R3 = 3.3 #Resistance (in kilo-ohm)
V2 = 6 #Voltage drop across R2 (in volts)
#Calculation
I = V2 / R2 #Current in the circuit (in milli-Ampere)
V1 = R1 * I #Voltage drop across R1 (in volts)
V3 = R3 * I #Voltage drop across R3 (in volts)
#Result
print "The voltage drop across R1 is ",V1,"V and the voltage drop across R3 is ",V3," V."
```

In [6]:

```
import math
#Variables
V = 30.0 #Source voltage (in volts)
R1 = 20.0 #Resistance (in kilo-ohm)
R2 = 10.0 #Resistance (in kilo-ohm)
R3 = 70.0 #Resistance (in kilo-ohm)
VD = 0.0 #Voltage at D (in volts)
#Calculation
R = R1 + R2 + R3 #Equivalent Resistance (in kilo-ohm)
V1 = (R1 / R) * V #Voltage drop across R1 (in volts)
V2 = (R2 / R) * V #Voltage drop across R2 (in volts)
V3 = (R3 / R) * V #Voltage drop across R3 (in volts)
VC = V3 + VD #Voltage at node C (in volts)
VB = V2 + VC #Voltage at node B (in volts)
VA = V1 + VB #Voltage at node A (in volts)
#Result
print "The Voltage drop across R1 is ",V1," V.\nThe Voltage drop across R2 is ",V2," V.\nThe Voltage drop across R3 is ",V3," V."
print "Voltage at node A is ",VA," V.\nVoltage at node B is ",VB," V.\nVoltage at node is ",VC," V."
```

In [7]:

```
import math
#Variables
R2 = 100 #Resistance R2 (in ohm)
I = 0.3 #Current (in Ampere)
VT = 120 #Voltage (in volts)
#Calculation
RT = VT / I #Total Resistance (in ohm)
R1 = RT - R2 #Resistance R1 (in ohm)
P1 = I**2 * R1 #Power dissipated by R1 (in watt)
P2 = I**2 * R2 #Power dissipated by R2 (in watt)
#Result
print "The power dissipated by R1 is ",P1," W.\nThe power dissipated by R2 is ",P2," W."
```

In [8]:

```
import math
#Variables
V = 6 #Voltage (in volts)
R1 = 1 #Resistance (in ohm)
R2 = 2 #Resistance (in ohm)
R3 = 3 #Resistance (in ohm)
#Case (a):
#Calculation
RT = R1 + R2 + R3 #Equivalent Resistance (in ohm)
I = V / RT #Current (in Ampere)
P = I**2 * RT #Power dissipated (in watt)
#Result
print "Power dissipated in the entire circuit is",P," W."
#Case (b):
#Calculation
RT = R1 + R2 #Equivalent Resistance (in ohm)
I = V / RT #Current (in Ampere)
P = I**2 * RT #Power dissipated (in watt)
#Result
print "Power dissipated in the circuit when R2 is shortened is",P," W."
#Case (c):
#Calculation
R = R1 #Resistance (in ohm)
I = V / R #Current (in Ampere)
P = I**2 * R #Power dissipated (in watt)
print "Power dissipated in the circuit when R3 and R2 is shortened is",P," W."
```

In [9]:

```
import math
#Variables
V = 10.0 #Voltage (in volts)
R1 = 10**6 #Resistance (in ohm)
R2 = 10 * 10**3 #Resistance (in ohm)
#Case (a):
#Calculation
RT = R1 + R2 #Total Resistance (in ohm)
I = V / RT #Current (in Ampere)
#Result
print "Current through the circuit is ",I," A."
#Case (b):
#Calculation
RT = R1 #Total Resistance (in ohm)
I = V / RT #Current (in Ampere)
#Result
print "Current through circuit when R2 is shortened is ",I," A."
```

In [10]:

```
import math
#Variables
IT = 750 #Current (in milli-Ampere)
I1 = 200 #Current (in milli-Ampere)
I3 = 150 #Current (in milli-Ampere)
#Calculation
I2 = IT - (I1 + I3) #Current through R2 (in milli-Ampere)
#Result
print "Current drawn by R2 branch is ",I2," mA."
```

In [11]:

```
import math
#Variables
V = 12.0 #Voltage (in volts)
R1 = 4.0 #Resistance (in ohm)
R2 = 6.0 #Resistance (in ohm)
R3 = 12.0 #Resistance (in ohm)
#Calculation
Req = 1/(1/R1 + 1/R2 + 1/R3) #Equivalent resistance (in ohm)
I1 = V/R1
I2 = V/R2
I3 = V/R3
#Result
print "The Equivalent Resistance is ",Req," ohm.\nThe Current through R1 , R2 , R3 are ",I1," A, ",I2," A, ",I3," A."
```

In [12]:

```
import math
#Variables
R1 = R2 = 10 #Resistances (in kilo-ohm)
#Calculation
Req = R1*R2 / (R1 + R2) #Equivalent Resistance (in kilo-ohm)
#Result
print "The equivalent resistance is ",Req," kilo-ohm."
```

In [13]:

```
import math
#Variables
R1 = 4.0 #Resistance (in ohm)
R2 = 12.0 #Resistance (in ohm)
V = 6.0 #Voltage (in volts)
#Calculation
Req = R1*R2/(R1 + R2) #Equivalent Resistance (in ohm)
IT = V / Req #Total Current (in Ampere)
I1 = R2 / (R1 + R2) * IT #Current through R1
I2 = R1 / (R1 + R2) * IT #Current through R2
#Result
print "Current through R1 is ",I1," A and current through R2 is ",I2," A."
```

In [1]:

```
import math
#Variables
PR1 = 1.0/8 #1/8 watt resistor (in watt)
PR2 = 1.0/4 #1/4 watt resistor (in watt)
PR3 = 1.0/2 #1/2 watt resistor (in watt)
RT = 2400.0 #total resistance (in ohm)
#Calculation
PT = PR1 + PR2 + PR3 #Total power dissipated (in watt)
I = (PT/RT)**0.5 #Current (in Ampere)
Vs = I * RT #Applied voltage (in volts)
R1 = PR1 / I**2 #R1 resistor (in ohm)
R2 = PR2 / I**2 #R2 resistor (in ohm)
R3 = PR3 / I**2 #R3 resistor (in ohm)
#Result
print "Current in the circuit is ",round(I,3)," A.\nApplied Voltage is ",round(Vs,3)," V.\nValue of R1 is ",round(R1,3)," ohm.\nValue of R2 is ",round(R2,3)," ohm.\nValue of R3 is ",round(R3,3)," ohm."
#Slight variations due to higher precision.
```

In [15]:

```
import math
#Variables
V = 6.0 #Applied voltage (in volts)
R0 = 0.2 #Resistance (in ohm)
R1 = 2.0 #Resistance (in ohm)
R2 = 3.0 #Resistance (in ohm)
R3 = 6.0 #Resistance (in ohm)
#Calculation
Req = 1 / (1/R1 + 1/R2 + 1/R3) #Equivalent Resistance (in ohm)
R = R0 + Req #Total Resistance (in ohm)
I = V/R #Current (in Ampere)
V0 = I * R0 #Voltage drop across R0 (in volts)
Veq = V - V0 #Voltage drop across Req (in volts)
I1 = Veq / R1 #Current through R1 (in Ampere)
I2 = Veq / R2 #Current through R2 (in Ampere)
I3 = Veq / R3 #Current through R3 (in Ampere)
P = V * I #Power supplied by the voltage source (in volts)
I0 = V/R0 #Current in case of 'Short' across DE (in Ampere)
P0 = V * I0 #Power dissipated in case of 'Short' (in watt)
#Result
print "Total Resistance is ",R," ohm."
print "Branch Currents :\nThrough R1 = ",I1," A.\nThrough R2 = ",round(I2,3)," A.\nThrough R3 = ",round(I3,3)," A."
print "Current supplied by voltage source is ",I," A."
print "Power supplied by the voltage source is ",P," W."
print "Current supplied in case of 'Short' across DE is ",I0," A."
print "Power supplied in case of 'Short' acorss DE is ",P0," A."
```