In [1]:

```
import math
from __future__ import division
#initialisation of variables
e=1.6*10**-19; #charge on an electron in coulomb
i=1; #current in Ampere
#CALCULATIONS
n=i/e; #calculating no of electrons/sec
#RESULTS
print"No. of electrons flowing per second =",'%.3E'%n;
```

In [2]:

```
import math
from __future__ import division
#initialisation of variables
v=120; #potential diff in Volt
r=12; #resistance in ohms
#CALCULATIONS
i=v/r; #calculating current in Ampere using Ohm's law ie. V=I*R
#RESULTS
print"Current in the toaster in Ampere =",round(i);
```

In [3]:

```
import math
from __future__ import division
#initialisation of variables
v=120; #potential diff in volt
i=25; #current in Ampere
#CALCULATIONS
r=v/i; #Ohm's law
#RESULTS
print"Resistance in ohm =",round(r,2);
```

In [4]:

```
import math
from __future__ import division
#initialisation of variables
v=240; #potential diff in volt
p=2000; #power in Watt
#CALCULATIONS
p1=p/v;
#RESULTS
print"Current in Ampere =",round(p1,3);
```

In [5]:

```
import math
from __future__ import division
#initialisation of variables
pi=12*746; #input power in Watt sice 1hp=746 Watt
i=30; #current in Ampere
v=240; #potential difference in volt
#CALCULATIONS
po=v*i; #calculating output power using p=v*i
e=po/pi; #calculating efficiency using eff=oupt/input
e1=e*100;
#RESULTS
print"Efficiency of the generator =",round(e1,3);
```

In [6]:

```
import math
from __future__ import division
#initialisation of variables
i=15; #current in Ampere
v=240; #potential diff. in Volt
t=45/60; #time in hours
#CALCULATIONS
p=v*i; #clculating power in Watt using p=v*i
w=p*t; #calculating work done in Watt.h using w=p*t
w1=w/1000;
#RESULTS
print"Work done in kiloWatt.hr =",round(w1,3);
```

In [7]:

```
import math
from __future__ import division
#initialisation of variables
v=12; #potential diff. in volt
i=20; #current in Ampere
t=3600; #time in sec
#CALCULATIONS
p=v*i; #power in Watt using p=v*i
w=p*t; #calculating work in Joule using w=p*t
#RESULTS
print"Work done in Joule =",round(w,3);
```

In [8]:

```
import math
from __future__ import division
#initialisation of variables
p=60; #power in Watt
c=80; #car capacity in Ampere.hr
t=3600; #time in seconds
v=12; #potential diff. in volt
#CALCULATIONS
q=c*t; #charge in Ampere.sec = Coulomb
w=q*v; #energy provided in Joule
t=w/p; #calculating time in second
t1=t/3600;
#RESULTS
print"(a) Energy stored in the battery in Joule =",round(w,3);
print"(b) Time the battery is on in hours =",round(t1,3);
```

In [9]:

```
import math
from __future__ import division
#initialisation of variables
v=600; #potential diff. in volt
i=10; #current in Ampere
#CALCULATIONS
r=v/i; #calculating resistence in ohm using ohm's law ie.v=i*r
#RESULTS
print"Resistence in Ohm =",round(r,3);
```

In [10]:

```
import math
from __future__ import division
#initialisation of variables
v=60; #potential diff in volt
r1=5; #resistance in Ohm
r2=5; #resistance in Ohm
r3=5; #resistance in Ohm
#CALCULATIONS
r=r1+r2+r3; #resistance in series
i=v/r; #calculating current in Ampere using Ohm's law ie. V=I*R
#RESULTS
print"Resistance in Series in Ohm =",round(r,3);
print"Current in the entire circuit in Ampere =",round(i,3);
```

In [11]:

```
import math
from __future__ import division
#initialisation of variables
v=60; #potential diff in volt
r=5; #resistance in Ohm
r1=5; #resistance in Ohm
r2=5; #resistance in Ohm
r3=5; #resistance in Ohm
#CALCULATIONS
rp=(r1)**-1+(r2)**-1+(r3)**-1; #resistance in series
i=v/r; #calculating current in Ampere using Ohm's law ie. V=I*R
rp1=rp**-1;
#RESULTS
print"Resistance in Parallel in Ohm =",round(rp1,3);
print"Current in the entire circuit in Ampere =",round(i,3);
```

In [12]:

```
import math
from __future__ import division
#initialisation of variables
v=120; #potential diff in volt
r1=240; #resistance in ohm
r2=240; #resistance in ohm
#CALCULATIONS
r=r1+r2; #resistance in series
i=v/r; #calculating current in Ampere using Ohm's law
p=i*i*r1; #calculating power dissipated in each bulb in Watt
#RESULTS
print"(a)Current in each bulb in Ampere =",round(i,3);
print"(b)Power dissipated in each bulb in Watt =",round(p,3);
```

In [13]:

```
import math
from __future__ import division
#initialisation of variables
v=120; #potential diff in volt
r=240; #resistance in ohm
#CALCULATIONS
i=v/r; #current in Ampere using Ohm's law
p=i*i*r; #power in Watt
#RESULTS
print"(a)Current in each bulb in Ampere =",round(i,3);
print"Power dissipated in each bulb in Watt =",round(p,3);
```