n=int(input('Enter the number of capacitor used: '))
define single():
if n==1:
c=int(input("Enter the value of capacitor in mF"))
v=int(input('Enter the breakdownvoltage'))
vbr=v
print('The maximum safest voltage for given capacitors\in parallel combination is{}'.format(vbr))
single()
def combination():
if n==2:
comb=input('Enter the type of combination as S/s or P/p: ')
c1=int(input("Enter the capacitance of 1st \ capacitor in uF: "))
v1=int(input("Enter the breakdown voltage of\ 1st capacitor in voltes: "))
c2=int(input("Enter the capacitance of 2nd\ capacitor in uF: "))
v2=int(input("Enter the breakdown voltage of \2nd capacitor in voltes: "))
if comb=='s' or comb=='S':
vs1=(v1*(c1+c2)/c2)
vs2=(v2*(c1+c2)/c1)
vsafe1=min(vs1,vs2)
print('The maximum safest voltage for given capacitors\ in series combination is{}'.format(vsafe1))
elif comb=='P' or comb=='p':
v=min(v1,v2)
print('The maximum safest voltage for given capacitors\in parallel combination is{}'.format(v))