"Sound Heartbeat"

Soundheartbeat.com - ranking and value

Hey guys! It’s day 3 of my learning and I have made the project of calculating bill amount of Pizza. here, we are going to learn python free with project based life skill. adding daily a one project to our learn python free set.

Python will be within your limit just give 1 daily project dose to your self to learn python smoothly. Enhance your value of your resume to add skill in the resume.

So , here are the instructions

1)Pizza size = Small(S), Medium(M) or Large(L)

2)Do you want a pepperoni on pizza.

Write Y for Yes and N for No.

3) Would you like to have some extra cheese .

Write Y for Yes and N for No

These are the 3 inputs you should consider while taking the data from the customer.

To greet the customer , first write a welcome line to the customer. Such as .

print(“Hi, Welcome to the Pizza world”)

Now , write the inputs given above.

Size= input(“Which size of Pizza you would like to order?Small(S),Medium(M) or Large(L):”)

Pepperoni input(“Would like to add pepperoni on pizza ?Y/N:”)

Extra_cheese= input(“Would you like to add some extra cheese on pizza?Y/N:”)

These are 3 inputs remember, the important thing is,these are individual condition and should have it’s if and else statements { #which was one of my mistake)

Now , multiple if and else statement given below to run this code.

if size == "S": # character under" ""
print(f"cost of small pizza $ {bill}")
elif size=="M":
print(f"cost of medium pizza $ {bill}")
elif size=="L":
print(f"cost of large pizza $ {bill}")
if add_pepperoni=="Y": # mark this important
bill+= 2
print(f"Total Bill of pizza with pepperoni $ {bill}")
if extra_cheese=="Y":# important
bill+= 1
print(f"Total Bill of pizza with pepperoni and extra cheese $ {bill}")
print(f"Total bill for Pizza $ {bill}")

Things to remember while writing this code
1)Condition == “_”: #my first mistake
2) while checking condition of second input which is pepperoni choice . Start new if statement.

3) while checking 3rd input condition for extra cheese write new if statement under same indentation of earlier if statement. Because it is a continuous condition one after ther other . So, things must be considered while writing it.

Happy coding ๐Ÿ˜Š

Reference – replit.com




reference: replit.com<<click here>>

Pizza Billing using python #Basicsofpython


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!
en_GBEnglish (UK)