print("ms. Browning is in her office.".capitalize())
Ms. browning is in her office.
fav_color = "green"
print(fav_color.capitalize(), fav_color, fav_color,"and", fav_color.upper()+"!")
Green green green and GREEN!
# [ ] get input for a variable, fav_food, that describes a favorite food
print("My favorite food is pizza")
# [ ] display fav_food as ALL CAPS, used in a sentence
print("MY FAVORITE FOOD IS PIZZA")
# [ ] dispaly fav_food as all lower case, used in a sentence
print("my favorite food is pizza")
# [] display fav_food with swapped case, used in a sentence
print("My favorite food is pizza".swapcase)
My favorite food is pizza
MY FAVORITE FOOD IS PIZZA
my favorite food is pizza
<built-in method swapcase of str object at 0x7f0b45f40a80>
fav_color = "Forest Green"
# [] display the fav_color variable as upper, lower, swapcase, and capitalize formatting in a single print() statement
print(".capitalize forest green")
print(".lower forest green")
print(".upper FOREST GREEN")
print(".swapcase forest green")
.capitalize forest green
.lower forest green
.upper FOREST GREEN
.swapcase forest green
# review and run code - test a capitalized color input
fav_color = input('What is your favorite color?: ').lower()
print(fav_color)
bule
# [] input variable fav_color as upper
fav_color = input('What is your favorite color?: ').upper()
# [] print fav_color
print(fav_color)
BLUE
# review and run code to test if a string is to be found in another string
menu = "salad, pasta, sandwich, pizza, drinks, dessert"
print('pizza' in menu)
True
# review and run code to test case sensitive examples
greeting = "Hello World!"
print("'hello' in greeting = ",'hello' in greeting)
print("'Hello' in greeting = ", 'Hello' in greeting)
'hello' in greeting = False
'Hello' in greeting = True
# review and run code to test removing case sensitivity from a string comparison
greeting = "Hello World!"
print("'hello' in greeting = ",'hello' in greeting)
print("'Hello' in greeting = ", 'Hello' in greeting)
print("'hello' in greeting if lower used = ", 'hello'.lower() in greeting.lower())
'hello' in greeting = False
'Hello' in greeting = True
'hello' in greeting if lower used = True
# [] print 3 tests, with description text, testing the menu variable for 'pizza', 'soup' and 'dessert'
menu = "salad, pasta, sandwich, pizza, drinks, dessert"
print('pizza' in menu)
True
# Create a program where the user supplies input to search the menu
print("menu =salad, pasta, sandwich, pizza, drinks, dessert")
menu =salad, pasta, sandwich, pizza, drinks, dessert
# add to menu
print("menu = salad, pasta, sandwich, pizza, drinks, dessert")
print('pizza' in menu)
print("new menu = cold slaw, pizza, pie, icecream")
menu = salad, pasta, sandwich, pizza, drinks, dessert
True
new menu = cold slaw, pizza, pie, icecream
# Testing Add to Menu - create user input to search for an item on the new menu
print("new menu = cold slaw, pizza, pie, icecream")
new menu = cold slaw, pizza, pie, icecream
# [ ] fix the error
paint_colors = "red, blue, green, black, orange, pink"
print('red in paint colors')
red in paint colors