Introduction to Python

Python - Chapter 1

Python Tutorial

We appreciate your patience while we actively develop and enhance our content for a better experience.

Sample Code
print("Welcome to the Pizza Order App!")
size = input("What size pizza do you want? (S, M, or L) ")
add_pepperoni = input("Do you want to add pepperoni? (Y or N) ")
extra_cheese = input("Do you want extra cheese? (Y or N) ")

price = 0
if size == "S":
    price = 15
elif size == "M":
    price = 20
elif size == "L":
    price = 25

if add_pepperoni == "Y":
    if size == "S":
        price += 2
    else:
        price += 3

if extra_cheese == "Y":
    price += 1

print(f"Your final bill is: ${price}. Enjoy your pizza!")