Skip to main content

Python Bill Generator (only code)

 

I have made this Bill Generator using Python  Programming. This is a very useful Bill  Generator as it doesn't need adding operations every time.

HOW TO RUN THIS CODE:-

Download any python running IDE to run this code.

HERE's THE CODE:-

print("\n\t\tWELCOME TO MY BILL BOOK.\n")

print("PRESS 'q' TO STOP AT ANY MOMENT.")

amount = 0

kite = input("PRESS 's' TO START BILLING.\n==> ")

if(kite=="s") :

    while(True) :

        a = input("ENTER YOUR AMOUNT.\n==> ")

        if(a!='q') :

            amount = int(a)+amount

            print(f'TILL NOW YOUR BILL = {amount}')

            continue

        elif(a=="q") :

            print(f"YOUR TOTAL BILL = {amount}")

            print("THANKS FOR USING MY BILL GENERATOR.")

            break

elif(kite!="s") :

    print("THANKS FOR USING MY BILL GENERATOR.")


def billing() :

    amount = 0

    while(True) :

        a = input("ENTER YOUR AMOUNT.\n==> ")

        if(a!='q') :

            amount = int(a)+amount

            print(f'TILL NOW YOUR BILL = {amount}')

            continue

        elif(a=="q") :

            print(f"YOUR TOTAL BILL = {amount}")

            print("THANKS FOR USING MY BILL GENERATOR.")

            break


g = input("IF YOU WANT TO START BILLING AGAIN PRESS 's', OTHERWISE PRESS ANYTHING TO LEAVE.\n==> ")

if(g!="s") :

    print("THANKS FOR USING MY BILL GENERATOR.")

while(g=="s") :

    billing()

    g = input("IF YOU WANT TO START BILLING AGAIN PRESS 's', OTHERWISE PRESS ANYTHING TO LEAVE.\n==> ")

    if(g!="s") :

        print("THANKS FOR USING MY BILL GENERATOR.")

    elif(g=="s") :

        continue


# Hope it is really helpful 😊😊😊.

Comments

Popular posts from this blog

Stone, Paper and Scissor - Game (only code)

SPACE WAR - GAME