diff --git a/Chapter_04/4-13_buffet.py b/Chapter_04/4-13_buffet.py new file mode 100644 index 0000000..0a9c36d --- /dev/null +++ b/Chapter_04/4-13_buffet.py @@ -0,0 +1,15 @@ +# Exercise 4-12 Buffet +# Learning Objective: Use tuple, list it with for loop and reassign it. + +buffetFoods = ('carrots', 'potatoes', 'salad', 'beef', 'chicken') +print("The buffet offers the following foods:") +for food in buffetFoods: + print(food) +#try to modify to ensure error shows up: +# buffetFoods[3] = 'pork' ---> Confirmed error raised + +#menu changed: +buffetFoods = ('carrots', 'string beans', 'corn', 'beef', 'chicken') +print("\nThe buffet now offers the following foods: ") +for food in buffetFoods: + print(food)