inventory = ['pens', 'paper', 'staples', 'paperclips', 'tape', 'crayons', 'highlighters']
def do_we_have(item):
"""Prints out whether or not the item is in stock."""
if item in inventory:
print('We have', item, 'in stock!')
else:
print('We are out of', item)
do_we_have('staples')
do_we_have('paper')
do_we_have('pencils')
def greeter(name):
"""Prints a customized greeting for a person's name."""
if len(name) < 5:
print("Hello " + name + "! Is that your full name?")
elif len(name) <= 8:
print("Hello " + name + "! That's a lovely name!")
else:
print("Hello " + name + "! Can I call you " + name[:3] + "?")
greeter("Katy")
greeter("Manuel")
greeter("Wendell")
greeter("Wendell Smith")
greeter("Katy Krueger")