P_30 Coding Exercise for Beginners in Python | Exercise 9 | Python Tutorials for Beginners

preview_player
Показать описание
In this lecture we have written an automatic Pizza Order program in python.

*********************************************

Connect & Contact Me:

*******************************************

More Playlists:

#coding #pythonforbeginners #python #jennyslectures #pythonprogramming
Рекомендации по теме
Комментарии
Автор

I just wanted to express my gratitude for your dedication to teaching. Your passion for the subject shines through in every video, and I'm grateful to have access to such high-quality content

ayeshawaheed
Автор

Brain blessed with beauty 😀
Your kids must be proud of you 🙂

suryanshbaranwal
Автор

thanks you so much mam i practice in each and every day now

#pizza order program
print("1.Press 1 for small pizza\n2.Press 2 for medium pizza\n3.Press 3 for large pizza\n")
pizza = int(input("Which pizza do you want to eat?\n"))
price = 0
if pizza == 1:
price = 100
print("Pizza price is $100")
elif pizza == 2:
price =200
print("Pizza price is $200")
elif pizza == 3:
price = 300
print("Pizza price is $300")

pepperoni = str(input("Do you want to add pepperoni?(yes/no)\n"))
if pepperoni == 'yes' or pepperoni == 'no':
print("okay! Lets add pepperoni for you")
if pizza == 1:
price = price + 30
print(f"\nYour Pizza Price is now ${price}")
elif pizza == 2 or pizza == 3:
price = price + 20
print(f"\nYour Pizza Price is now ${price}")
elif pepperoni == 'no':
print("ok")

extra = str(input("\nDo you want to add extra cheese or extra big?(yes/no)\n"))
if extra == 'yes':
price = price + 40
print(f"\nFinal Price of your Pizza is ${price}")

else:
print("ok! Thank You")

mr_affan
Автор

Is declaration is compulsory mam, you declared that bill=0, other wise can I directly assign the value like bill=100

sravanthinandinig
Автор

size = input("enter size of the pizza (S, M, L):")
if size == 's' or size == 'S':
bill = 100
topings = input("Do you need pepperoni on your pizza(Y/N)")
if topings == 'Y' or topings == 'y':
bill = bill + 30
cheese = input("would you like to have extra cheese on it(Y/N)")
if cheese == 'Y' or cheese == 'y':
bill = bill + 20
print(f"Your total bill is {bill}")
else:
print(f"your total bill is {bill}")
elif size == 'M' or size == 'm':
bill = 200
topings = input("Do you need pepperoni on your pizza(Y/N)")
if topings == 'Y' or topings == 'y':
bill = bill + 50
cheese = input("would you like to have extra cheese on it(Y/N)")
if cheese == 'Y' or cheese == 'y':
bill = bill + 20
print(f"Your total bill is {bill}")
else:
print(f"your total bill is {bill}")
elif size == 'L' or size == 'l':
bill = 300
topings = input("Do you need pepperoni on your pizza(Y/N)")
if topings == 'Y' or topings == 'y':
bill = bill + 50
cheese = input("would you like to have extra cheese on it(Y/N)")
if cheese == 'Y' or cheese == 'y':
bill = bill + 20
print(f"Your total bill is {bill}")
else:
print(f"your total bill is {bill}")
else:
print("please enter valid input")

tnkmouli
Автор

Thank you mam. Practice questions make me more confidence 👍🏻

akhilsukumarp
Автор

Mam, is dsa needed for full stack development help me regarding this!

AshisH--
Автор

size = input("Which size you want? L/M/S: ")
bill = 0
if size == "S" or size == "s":
bill = 200
print("Pizza Price is 200 RS.")
elif size == "M" or size == "m":
bill = 400
print("Pizza Price is 400 RS.")
elif size == "L" or size == "l":
bill = 600
print("Pizza Price is 600 RS.")

pepperoni = input("Do you want Pepperoni? Y/N: ")

if pepperoni == "Y" or pepperoni == "y":
if size == "S" or size == "s":
bill = bill + 50
elif size == "M" or size == "m":
bill = bill + 100
elif size == "L" or size == "l":
bill = bill + 150

cheeze = input("Do you want cheeze? Y/N: ")

if cheeze == "Y" or cheeze == "y":
bill = bill + 50

print(f"Your total bill is {bill}")
print("Thank You!")

dzest
Автор

bill = 0

# Get pizza size
pizza = input("Enter your size of pizza (s/m/l): ").lower()

# Check pizza size and add to bill
if pizza == "s":
print("Cost is 100")
bill += 100
elif pizza == "m":
print("Cost is 150")
bill += 150
elif pizza == "l":
print("Cost is 200")
bill += 200
else:
print("Invalid size")

# Ask for pepperoni
pepperoni = input("Do you want pepperoni? (y/n): ").lower()
if pepperoni == "y":
print("Pepperoni required")
print("Cost +20")
bill += 20
else:
print("No pepperoni required")

# Ask for extra cheese
cheese = input("Do you want extra cheese? (y/n): ").lower()
if cheese == "y":
print("Extra cheese added")
print("Cost +20")
bill += 20
else:
print("No extra cheese")

# Final bill
print(f"Total bill = {bill}")

NarneBhavishya
Автор

pizza = input("Do you want to order pizza(Y/N)? ")
bill = 0
if pizza == "y" or pizza == "Y":
print ("Choose your pizza size")
print ("1. Small Pizza = RS 100\n2. Medium Pizza = RS 200\n3. Large Pizza = RS 300")
Select_Pizza = int(input("Type number before pizza name: "))
if Select_Pizza == 1:
bill =100
toppings = input("Do you want to add Pepperoni(Y/N)? ")
if toppings == "y" or toppings == "Y":
bill = bill + 30
else :
print ("You need to pay", bill, "Rupees")

if Select_Pizza == 2:
bill =200
toppings = input("Do you want to add Pepperoni(Y/N)? ")
if toppings == "y" or toppings == "Y":
bill = bill + 50
else :
print ("You need to pay", bill, "Rupees")

if Select_Pizza == 3:
bill =300
toppings = input("Do you want to add Pepperoni(Y/N)? ")
if toppings == "y" or toppings == "Y":
bill = bill + 50
else :
print ("You need to pay", bill, "Rupees")

cheese = input("Do you want to add extra cheese(Y/N)? ")
if cheese == "y" or toppings == "Y":
bill = bill+ 20
print ("You need to pay", bill, "Rupees")
else:
print ("Thanks for coming")

MohdAman-yi
Автор

mam one doubt if valid indicate that he entered wrong size where sholud we add that statement invalid input so i need to get in valid input and get terminated the program

gurutej
Автор

bill=0
pizza=input("Enter size of pizza(S/M/L):")
if(pizza=="S" or pizza=="s"):
ses=input("Do you want seasoning(Y/N): ")
if(ses=='Y' or ses=='y'):
bill+=100+30
else:
bill+=100
elif(pizza=="M" or "m"):
ses=input("Do you want seasoning(Y/N): ")
if(ses=='Y' or ses=='y'):
bill+=200+50
else:
bill+=200
elif(pizza=="l" or "L"):
ses=input("Do you want seasoning(Y/N):")
if(ses=='Y' or ses=='y'):
bill+=300+20
else:
bill+=300
extra_cheese=input("extra cheese ?(Y/N)")
if(extra_cheese=='Y'or extra_cheese=='y'):
bill+=20
else:
bill=bill
print("Bill is ", bill)





Is this program correct mam?

anisha_sivakumar_
Автор

Hey ma'am I'm enjoying your lessons

KudakwasheMutizamhepo
Автор

I don't even know why I'm here😜but I'm here😂

manideep_gowd
Автор

print("Pizza hut")
print("Menu : \n 1.Small Pizza -100 \n 2.Medium Pizza-200 \n 3. Large pizza -300")
print("Extra topup also present on various combination")
order=input("Wants order pizza(Y/N)? ")
if order =='y'or order =='Y':
bill=0
order_size=input("Which size of pizza you want to order (S/M/L)")
if order_size=='s' or order_size=='S':
bill=100
#print(f"your bill for your pizza is {bill}")
extra=input("wants some extra pepporeni(y/n)?")
if extra=='y' or extra=='Y':
bill= bill+30
print(f"your total bill for your pizza is :{bill}")
else:
print(f"your bill for your pizza is {bill}")


elif order_size=='M' or order_size=='m':
bill=200
# print(f"your bill for your pizza is {bill}")
extra=input("wants some extra pepporeni(y/n)?")
if extra=='y' or extra=='Y':
bill= bill+50
print(f"your total bill for your pizza is :{bill}")
else:
print(f"your bill for your pizza is {bill}")



elif order_size=='l' or order_size=='L':
bill=300
#print(f"your bill for your pizza is {bill}")
extra=input("wants some extra cheeze (y/n)?")
if extra=='y' or extra=='Y':
bill=bill+20
print(f"your total bill for your pizza is :{bill}")
else:
print(f"your bill for your pizza is {bill}")

else:
print("You have to give us a chance surely")
print("Thankyou for visiting us \n We will expect to see you soon ")




that is what i made at first .😅😅😅

pwinsider-pwpupil
Автор

size=input("which pizza do you wany s/m/l?")
if(size == 's'):
bill=100
print("small pizza is 100rs")
p=input("do u want to add 50rs pepperoni on it?(y/n)")
if(p=='y'):
bill=bill+30
print(f"your total bill is{bill}")
if(p!='y'):
print(f"your total bill is {bill}")
c=input("do u want to add extra 20rs cheese on it?(y/n)")
if(c=='y'):
bill=bill+20
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
elif(size=="m"):
print("medium size pizza is 200rs")
bill=200
m=input("do u want to add 50rs pepperoni on it?(y/n)")
if(m=='y'):
bill=bill+50
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
c=input("do u want to add 20rs extra cheese on it?(y/n)")
if(c=='y'):
bill=bill+20
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
elif(size=="m"):
print("medium size pizza is 200rs")
bill=200
m=input("do u want to add 50rs pepperoni on it?(y/n)")
if(m=='y'):
bill=bill+50
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
c=input("do u want to add 20rs extra cheese on it?(y/n)")
if(c=='y'):
bill=bill+20
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
elif(size=="l"):
print("large size pizza is 300rs")
bill=300
m=input("do u want to add 50rs pepperoni on it?(y/n)")
if(m=='y'):
bill=bill+50
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
c=input("do u want to add 20rs extra cheese on it?(y/n)")
if(c=='y'):
bill=bill+20
print(f"ur total bill is{bill}")
else:
print(f"ur total bill is{bill}")
else:
print("we will not prepare that")

awmkingjagguvinay
Автор

order = input("Enter you Pizza type Small/Medium/Large : ")
bill = 0
if order == "Small" or order == "small":
peperoni = input("Do you need Pepperoni : Y/N ")

bill = 100

if peperoni == "Y" or peperoni == "y":
bill = bill + 30

print("Pay ", bill)
elif order == "Medium" or order == "medium":
peperoni = input("Do you need Pepperoni : Y/N ")

bill = 200

if peperoni == "Y" or peperoni == "y":
bill = bill + 50

print("Pay ", bill)

else:
peperoni = input("Do you need Pepperoni : Y/N ")

bill = 300

if peperoni == "Y" or peperoni == "y":
bill = bill + 50
print("Pay ", bill)

Extra_cheese = input("Do you need extra cheese : Y/N ")
if Extra_cheese == "Y" or Extra_cheese == "y":
bill = bill + 20

print("Your total bill is : ", bill)

malik
Автор

mam your explanation is very well, but one small feedback there is a one error in your code if(size =='S' or size=='s'):, before this we need to give input size=(input("enter size of pizza:")), Then only we will get correct output.

viswanath
Автор

mam can we use
if add - pepproni == 'y' and size == 's'
as a one line . instead of using two if conditions ??

RaniGanaparthi
Автор

import sys
print("Welcome to Nmoh's pizzary")
bill = 0
order = int(input("What size of pizza do you want?\nEnter 1 for small\nEnter 2 for medium \nEnter 3 for large\nEnter choice of order: "))
if(order < 1 or order > 3):
print("Enter valid number")
sys.exit()
extra_pep = input("Do you want extra pepperoni?\nEnter Y/N: ")
if(order == 1 and extra_pep == 'y' or extra_pep == 'Y'):
bill = 100 + 30
elif(order == 1 and extra_pep == 'n' or extra_pep == 'N'):
bill = 100
if(order == 2 and extra_pep == 'y' or extra_pep == 'Y'):
bill = 200 + 50
elif(order == 2 and extra_pep == 'n' or extra_pep == 'N'):
bill = 200
if(order == 3 and extra_pep == 'y' or extra_pep == 'Y'):
bill = 300 + 50
elif(order == 3 and extra_pep == 'n' or extra_pep == 'N'):
bill = 300
extra_cheese = input("Do you want extra cheese?\nEnter Y/N: ")
if(extra_cheese == 'Y' or extra_cheese == 'y'):
total_bill = bill + 20
elif(extra_cheese == 'N' or extra_cheese == 'n'):
total_bill = bill
print(f"your total bill is #{total_bill}")
print("Thank you for your patronage")

chinenyeumeaku
visit shbcf.ru