
def greet_user():
    print("Hello!")

greet_user()



def greet_user(name):  #name = Parameter
    print("Hello, ", name)

greet_user("Lina")     # "Lina" = Argument



def describe_pet(animal, name):
    print("I have a ", animal, " named ",name)

describe_pet("dog", "Max")
describe_pet("Max", "dog")


def describe_pet(animal, name):
    print("I have a ", animal, " named ",name)

describe_pet(animal="dog", name="Max")
describe_pet(name="Max", animal="dog")


def describe_pet(name, animal = "dog" ):
    print("I have a ", animal, " named ",name)

describe_pet(name="Max", animal="dog")
describe_pet(name="Max")
describe_pet(name="Max", animal="cat")

def greet_user(name):
    print("Hello, ", name)

greet_user() # -> Argument Error



def print_full_name(first, last, middle=""):
    if middle:
        print(first, middle, ",", last)
    else:
        print(first, ",", last)

print_full_name("John", "Doe") # John , Doe
print_full_name("John", "Doe", "Lee") # John Lee , Doe




def print_full_name(first, last, middle=None):
    if middle:
        print(first, middle, ",", last)
    else:
        print(first, ",", last)

print_full_name("John", "Doe") # John , Doe
print_full_name("John", "Doe", "Lee") # John Lee , Doe

def add(a, b):
    print(a + b)

add(1, 2)

def add(a, b):
    return a + b

c = add(1, 2)

print(c)


def get_full_name(first, last):
    full = first + " " + last
    return full.title()


musician = get_full_name("jimi", "hendrix")
print(musician) # Jimi Hendrix



def return_full_name(first, last, middle=None):
    if middle:
        full_name = first + " " + middle + ", " + last
    else:
        full_name = first + ", " + last

    return full_name

full_name = return_full_name("John", "Doe")
print(full_name) # John, Doe
full_name = return_full_name("John", "Doe", "Lee")
print(full_name) # John Lee, Doe



def build_person(first, last, age):
    person = {"first": first, "last": last}
    person["age"] = age
    return person

musician = build_person("jimi", "hendrix", 27)
print(musician) # {'first': 'jimi', 'last': 'hendrix', 'age': 27}
print(musician["first"]) # jimi


def pos_or_neg(number):
    if number < 0:
        return "Negative"
    elif number > 0:
        return "Positive"

r = pos_or_neg(3)
print(r) # Positive



def square(n):
    return n ** 2

numbers = [1, 2, 3, 4]
results = []
for n in numbers:
    results.append(square(n))

print(results)



def move(src):
    dst = []
    while src:
        dst.append(src.pop())
    return dst


old = ['a', 'b']
new = move(old[:]) # use copy !!!
print(new) # ['b', 'a']
print(old) # ['a', 'b'] stays unchanged


def pizza(*args):
    print('Pizza with:', args)

pizza('cheese') # Pizza with: ('cheese',)
pizza('mushroom', 'onion') # Pizza with: ('mushroom', 'onion')



t = ("cheese","mushroom","onion") # immutable
l = ["cheese","mushroom","onion"] # mutable


def pizza(size, *t):
    print(size, 'inch:', t)

pizza(12, 'cheese', 'olives')


def car(make, model, **x):
    x['make'] = make
    x['model'] = model
    return x

car1 = car('BMW', 'X3', color='red')
print(car1) # {'color': 'red', 'make': 'BMW', 'model': 'X3'}


"""
Build one pizza-ordering function that grows with each task.
Each new task improves the same function, not a new one.

---

Task 1
Make a function `make_pizza()` that simply prints:
`Making your pizza...`
Then call it once.

---

Task 2
Add one parameter `size` to the function so it prints:
`Making a 12 inch pizza...`

*Hint:*
Use an f-string and call it with one argument:


def make_pizza(size):
    print(f"Making a {size} inch pizza...")

make_pizza(12)


---

Task 3
Add another parameter `topping` so the function prints:
`Making a 12 inch pizza with cheese.`


Parameters go inside parentheses separated by commas:


def make_pizza(size, topping):
    print(f"Making a {size} inch pizza with {topping}.")


---

Task 4
Allow the user to **type** the size and topping.
Ask for both values inside the function using `input()`, and print the same sentence.

*Hint:*
Use:


size = input("Enter pizza size: ")
topping = input("Enter one topping: ")


---

Task 5
Let the user enter **multiple toppings** separated by commas.
Use `.split(',')` to turn the text into a list.

*Hint:*


toppings = input("Enter toppings (comma separated): ").split(',')
print(toppings)


---

Task 6
Modify the print line so it lists all toppings in one sentence.
Example output:
`Making a 12 inch pizza with cheese, tomato, and olives.`

*Hint:*
Use `', '.join(toppings)` inside your f-string.

---

Task 7
Add a **return** statement that returns a dictionary with the order details, e.g.:
`{'size': '12', 'toppings': ['cheese', 'tomato']}`

*Hint:*


return {'size': size, 'toppings': toppings}


---

Task 8
Outside the function, store the result in a variable `order` and print it.

*Hint:*

order = make_pizza()
print(order)


---

Task 9
Add one more piece of information — crust type — to the order.
Ask for it with `input()` and add it to the dictionary.

*Hint:*
Add another key:


order['crust'] = crust


---

Task 10
Add an optional delivery choice.
Ask: `Delivery? (yes/no):`
If the user types `yes`, include `'delivery': True` in the dictionary.

*Hint:*
Use a simple `if` statement before returning the order.

---

Task 11
After returning the order, print a nice summary line such as:
`12 inch pizza with cheese and tomato (crust: thin, delivery: True)`

*Hint:*
Use `print()` after the function call and format using the dictionary values.

---

Task 12
Let the user place **two orders** and store them in a list `all_orders`.
Then loop through the list and print each order summary.

*Hint:*
Use a loop:


for o in all_orders:
    print(o)


---

**End Goal Output Example:**


Enter pizza size: 12
Enter toppings (comma separated): cheese,tomato
Enter crust type: thin
Delivery? (yes/no): yes

12 inch pizza with cheese and tomato (crust: thin, delivery: True)


"""

