You are on page 1of 4

ASSIGNMENT-2

Name: Sivabalaji T
Batch: 57
Whatapp group: Besant_Python_Boys_B57
College: M. Kumarasamy College of Engineering
Email: sivabalaji525@gmail.com
Phone: 6381521259
Place: Namakkal(Dt)
------------------------------------------------------------------------------
Code:
def cup():
        global d
        global b
        print('''Press: 1 for Chocolate Flavour Rs.30 Each
       2 for Staberry Flavour  Rs.40 Each
       3 for Vanilla Flavour   Rs.50 Each''')
        c=int(input("\nPress the number: "))
        b=int(input("How many cups do you need? "))
        if c==1:
            d=30
        elif c==2:
            d=40
        elif c==3:
            d=50
        else:
            print("Try again")  

def cone():
        global d
        global b
        print('''Press: 1 for Chocolate Flavour Rs.60 Each
       2 for Staberry Flavour  Rs.70 Each
       3 for Vanilla Flavour   Rs.80 Each''')
        c=int(input("\nPress the number: "))
        b=int(input("How many cones do you need? "))
        if c==1:
            d=60
        elif c==2:
            d=70
        elif c==3:
            d=80
        else:
            print("Try again")

def cake():
        global d
        global b
        print('''Press: 1 for Chocolate Flavour Rs.100 Each
       2 for Staberry Flavour  Rs.120 Each
       3 for Vanilla Flavour   Rs.160 Each''')
        c=int(input("\nPress the number: "))
        b=int(input("How many cakes do you need? "))
        if c==1:
            d=100
        elif c==2:
            d=120
        elif c==3:
            d=160
        else:
            print("Try again")
def cherry():
    global q
    q=0
    p=input("Do you need Cherry is your ice cream? (Yes/No): ").lower().strip()
    if p=="yes":
        q+=10
    elif p=="no":
        q=0
    else:
        print("Try again.")
def bill():
    print("__________________________________________________")
    print("YOUR BILL:")
    print("Cost of each Cherry:                        Rs.10")
    if q!=0:
         print(f"Price of the one ice cream with cherry:     Rs.{d+q}")
         print(f"The price of {b} ice cream with cherry:       Rs.{(d+q)*b} ")
         print("__________________________________________________")
         print(f"YOUR TOTAL BILL:                         Rs.{(d+q)*b} ")
         print(f"--------------------------------------------------")
    else:    
         print(f"Price of the one ice cream without cherry:  Rs.{d+q}")
         print(f"The price of {b} ice cream without cherry:    Rs.{(d+q)*b}")
         print("___________________________________________________")
         print(f"YOUR TOTAL BILL:                            Rs.{(d+q)*b} ")
         print(f"---------------------------------------------------")
    print("Thank you for coming.".upper())      

print("""WELCOME TO THE MIRA ICREAM SHOP


Press: 1 for CUP
       2 for CONE
       3 for CAKE""")
a=int(input("Press the number: "))
if a==1:
    cup()
elif a==2:
    cone()
elif a==2:
    cake()
else:
    print("Try Again")
cherry()
bill()

Output after Execution:

You might also like