from __future__ import division
import math
#Initialization
V=240 #Voltage in volts
#Resistance in Ohm
R1=400
R2=500
#Cal of current in each resistor
I1=V/R1
I2=V/R2
print "(a) I1=" ,I1,"A","I2=",I2,"A"
#Cal of total current
I=I1+I2
print "(b) I=",I,"A"
#Cal of Total resistance
R=V/I
print "(c) R=",int(R),"Ohm"
#Cal of Total power
P=I*V*math.cos(0)
print "(d) P=",int(P),"W"
from __future__ import division
import math
#Initialization
#Capacitance in muF
C1=30
C2=50
V=50 #Voltage in volts
f=400 #frequency in Hz
#Cal of current in each resistor
Xc1=1/(2*3.14*f*C1*10**-6)
I1=V/Xc1
Xc2=round(1/(2*3.14*f*C2*10**-6))
I2=V/Xc2
print "(a) I1=",round(I1,1),"A"
print " I2=",I2,"A"
#Cal of total current
I=I1+I2
print "(b) I=",int(I),"A"
#Cal of Impedance
Z=V/I
print "(c) Z=",int(round(Z)),"Ohm"
#Cal of Total power
W=I*V*math.cos(math.radians(90))
print "(d) W=",int(W)
from __future__ import division
import math
#Cal of resonance frquency
#Initialization
L=180 #Inductance in muH
C=100 #Capacitance in pF
#Calculation
L=L*(10**-6)
C=C*(10**-12)
fo=1/((2*math.pi)*(math.sqrt(L*C)))
fo=fo/10**6 #Convert fo in MHz
print "fo=",round(fo,1),"MHz"