def amount(n):
return lambda a : a * n
def amount1(n):
return lambda a, b, c : a*n + b*c
def amount2(n):
return lambda a, b, c, d, e: a*n + b*d + c*e
print("\n\t ELECTRIC BILL")
print("\t1.Domestic\n\t2.Cottage and Tiny Industries\n\t3.Industries\n\t4.Public workshop\n\t5.Private Hospital Institution")
print("\t6.Govt and aided Educational Institutions,Hospitals and Research labs")
a=int(input("\n\tEnter the Category:"))
b=input("\tEnter the service.No:")
c=int(input("\tEnter the No.of units consumed:"))
b=str (input("\tEnter the month:"))
d=str(input("\tIts present month(YES OR NO):"))
if a==1:
if c<=100:
amount="BELOW 100 UNITS FREE CHARGE"
print("\n\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif c<=200:
z=c-100
x = amount(z)
amount=(x(1.5))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=100
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif c<=500:
x=amount1(100)
z=c-200
amount=(x(2,3,z))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=100
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif c>500:
z=c-500
x=amount2(100)
amount=(x(3.5, 4.6, 6.6,300,z))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=100
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif a==2:
if c<=500:
x=amount(c)
amount=(x(4))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif c>500:
x=amount(c)
amount=(x(4.6))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif a==3:
x=amount(c)
amount=(x(6.35))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif a==4:
if c<=120:
x=amount(c)
amount=(x(2.85))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif c>120:
x=amount(c)
amount=(x(5.75))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif a==5:
x=amount(c)
amount=(x(7.5))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif a==6:
x=amount(c)
amount=(x(5.75))
if d=="YES":
print("\n\tE-Charge:",amount)
print("\tTotal amount:",amount)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
elif d=="NO":
penalty=120
total=penalty+amount
print("\n\tE-Charge:",amount)
print("\tpenalty:",penalty)
print("\tTotal amount:",total)
print("\n\tPls, press the pay button.")
print("\tAmount payed")
Output:
ELECTRIC BILL
1.Domestic
2.Cottage and Tiny Industries
3.Industries
4.Public workshop
5.Private Hospital Institution
6.Govt and aided Educational Institutions,Hospitals and Research labs
Enter the Category:2
Enter the service.No:TNSW0324T23
Enter the No.of units consumed:210
Enter the month:AUGUST
Its present month(YES OR NO):YES
E-Charge: 840
Total amount: 840
Pls, press the pay button.
Amount payed