

1 == 2
2 == 2

car = 'bmw'
print(car == 'bmw') # True
print(car == 'audi') # False



car = 'bmw'
car == 'bmw' # True
car != 'bmw' # False
car != 'audi' # True



car = 'Audi'
print(car == 'audi') # False
print(car.lower() == 'audi') # True


age = 19
print(age < 21) # True
print(age >= 21) # False


age_0 = 22
age_1 = 18
print(age_0 >= 21 and age_1 >= 21) # False


age_0 = 22
age_1 = 18
print(age_0 >= 21 or age_1 >= 21) # True


requested_toppings = ['mushrooms', 'onions']
print('mushrooms' in requested_toppings) # True


banned_users = ['andrew', 'carolina']
user = 'marie'
print(user not in banned_users) # True



game_active = True
can_edit = False

True == False
True == True
True != False
True != True

bigger = 1 > 0
print(bigger) # True


age = 19
if age >= 18:
    print("You are old enough to vote!")


age = 12
if age < 4:
    price = 0
elif age < 18:
    price = 25
else:
    price = 40


age = 70
if age < 4:
    price = 0
elif age < 18:
    price = 25
elif age < 65:
    price = 40
else:
    price = 20


age = 70
if age < 4:
    price = 0
elif age < 18:
    price = 25
elif age < 65:
    price = 40
elif age >= 65:
    price = 20


toppings = ['mushrooms', 'extra cheese']

if 'mushrooms' in toppings:
    print("Adding mushrooms.")

if 'extra cheese' in toppings:
    print("Adding extra cheese.")




available_toppings = ['mushrooms', 'extra cheese']
requested_toppings = ['mushrooms', 'green peppers', 'extra cheese']

for topping in requested_toppings:
    if topping not in available_toppings:
        print("Sorry, ",topping," is not available today.")
else:
    print("Adding ",topping)



message = input("Tell me something: ")
print(message)

# Good prompt:
name = input("Please enter your name: ")
print(f"Hello, {name}!")

# Bad prompt:
name = input(": ")


age = input("How old are you? ")
print(age) # '21'
print(type(age)) # type: string


age = input("How old are you? ")
age = int(age)

if age >= 18:
    print("You can vote!")
else:
    print("Too young to vote.")


print(4 % 3) # 1
print(6 % 3) # 0


number = input("Enter a number: ")
number = int(number)

if number % 2 == 0:
    print("Even number")
else:
    print("Odd number")


current_number = 1
while current_number <= 5:
    print(current_number)
    current_number += 1



prompt = "\nTell me something, or 'quit' to stop: "
message = ""

while message != 'quit':
    message = input(prompt)
    if message != 'quit':
        print(message)



active = True
times = 0

while active: # same as: while active == True:
    message = input("Enter text (or 'quit'): ")
    if message == 'quit':
        active = False
    if times > 10:
        active = False
    else:
        print(message)
        times += 1 # same as: time =  time + 1


while True:
    city = input("Enter a city ('quit' to stop): ")
    if city == 'quit':
        break
    print(f"I'd love to go to {city}!")


number = 0
while number <6:
    number += 1
    if number == 3:
        continue
    print(number)



unconfirmed = ['alice', 'brian', 'candace']
confirmed = []

while unconfirmed:
    user = unconfirmed.pop()
    print(f"Verifying {user}")
    confirmed.append(user)


pets = ['dog', 'cat', 'dog', 'goldfish', 'cat']
while 'cat' in pets:
    pets.remove('cat')
    print(pets)




"""
EXERCISES

5-3. Alien Colors #1
Create a variable alien_color with value 'green', 'yellow', or 'red'.
If it is 'green' → print “Player earned 5 points”.
Write one version where the test passes and one where it fails.

5-4. Alien Colors #2
If the alien is green → 5 points.
If not → 10 points.
Write one version for each case.

5-5. Alien Colors #3
Use if-elif-else.
Green → 5 points, Yellow → 10 points, Red → 15 points.
Write three versions to test all branches.


5-6. Stages of Life
Use variable age.
<2 → baby, 2–4 → toddler, 4–13 → kid, 13–20 → teenager, 20–65 → adult, ≥65 → elder.

5-7. Favorite Fruit
Make a list favorite_fruits with 3 fruits.
Write 5 independent if tests.
If a fruit is in the list → print “You really like bananas!” (etc.).

5-8. Hello Admin
Make a list of usernames (include 'admin').
Loop through names.
If 'admin' → print special greeting.
Else → print normal greeting.

5-9. No Users
Check if list of users is empty.
If empty → print “We need to find some users!”.

7-1. Rental Car
Ask the user which rental car they want.
Print “Let me see if I can find you a Subaru” (or chosen car).

7-2. Restaurant Seating
Ask how many people are in the dinner group.
If >8 → say they must wait.
Else → table ready.

7-3. Multiples of Ten
Ask the user for a number.
If number % 10 == 0 → say it’s a multiple of 10.
Else → not a multiple of 10.

7-4. Pizza Toppings
Ask for toppings until user types 'quit'.
Print message for each topping added.

7-5. Movie Tickets
Ask user’s age.
<3 → free, 3–12 → $10, >12 → $15.
Loop until user quits.

7-6. Three Exits
Modify Exercise 7-4 or 7-5 three ways:
Stop loop with condition in while.
Use an active flag.
Use break when user types 'quit'.

7-7. Infinity
Write a loop that never ends.
Stop it manually with CTRL+C.





"""
