from __future__ import division
from math import log10
Av=100##voltage gain
G=20*log10(Av)##gain in decibel
print "\n Therefore gain in decibel=%.0f dB \n"%(G)
from math import sqrt
Av=200##gain at cut-off frequencies
Avm=Av*sqrt(2)##maximum voltage gain
print "\n Therefore maximum voltage gain=%.2f \n"%(Avm)
from math import sqrt
Amid=100##mid-band gain
f1=1e3##loer cut-off frequency
f=20##frquency at which the gain of the amplifier should be found
A=Amid/sqrt(1+(f1/f)**2)
print "\n Therefore the gain of the amplifier at f = 20Hz is %.0f \n"%(A)
from math import sqrt
G=200##3dB gain
f2=20e3##higher cut-off frequency
Amid=G*sqrt(2)##mid-band gain
f=100e3##frquency at which the gain of the amplifier should be found
A=Amid/sqrt(1+(f/f2)**2)
print "\n Therefore the gain of the amplifier at f=100kHz is %.2f \n"%(A)
#in the book the answer for the gain is 115.47 which is wrong
#the corect answer is 55.47