"Sound Heartbeat"

Soundheartbeat.com - ranking and value

Make yourself ๐Ÿงฐ๐Ÿ‹๏ธ or talk about others ๐Ÿ˜‚ or just be an audience ๐Ÿ™‚

As we all know pandemic changes our lives completely. Many new career dimensions has come into the market and guess what now, picture is completely changed itself. Your data connection and data speed  allows you to take the class or say “GYAN”. And many job and skill based classes are Read more…

learn python free code

1 Project Daily, Learn python with Pizza Billing

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" ""
bill=15
print(f"cost of small pizza $ {bill}")
elif size=="M":
bill=20
print(f"cost of medium pizza $ {bill}")
elif size=="L":
bill=25
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}")
else:
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

#100daysofcode

#learnpythonbasic

#projectbasedlearning

reference: replit.com<<click here>>

Pizza Billing using python #Basicsofpython
(more…)
error: Content is protected !!
en_GBEnglish (UK)