# maximum current
import math
#Variable declaration
Pmax=364.0 #dissipation in milliwatt
Vz=9.1 #in V
#Calculations
Izmax=Pmax/Vz #in mA
#Result
print("maximum current the diode can handle is ,(mA)= %.f"%Izmax)
# resistance
import math
#Vaariable declaration
mip=15.0 #in volt
op=6.8 #output potential in volt
pd=mip-op #potential difference across series resistor
Il=5 #load current in mA
nmip=20 #new maximum input voltage in volt
pd1=nmip-op #new potential difference across series resistor
Il1=20 #new load current in mA
#Calculations
R=((pd1-pd)/((Il1-Il)*10**-3))
print("value of series resistance is,(ohm)= %.1f"%R)
# Current
import math
#VAriable declaration
V=120.0 #in V
Vz=50.0 #in V
R=5.0 #in ohm
Rl=10.0 #in k-ohm
#Calculations
vd5=V-Vz #voltage drop across 5 ohm resistor
I5=vd5/R #current through 5 ohm resistor
Il=Vz/(Rl*10**3) #current through load resistor
Iz=I5-Il #in A
#Result
print("current through zener diode is ,(A)= %.3f"%Iz)