#4.1 pizza
pizzas = ['durian', 'fruit', 'sausage', 'beef', 'pepperoni']
for pizza in pizzas:
print("I like " + pizza + " pizza!")
print("I really love pizza!")
#4.2 animals
animals = ['dog', 'cat', 'snake', 'puppy', 'kitten']
for animal in animals:
print("A " + animal + " would make a great pet for people.")
print("Any of these animals would make a great pet!"
#4.3 counting to 20
numbers = []
for number in range(1,21):
numbers.append(number)
print(numbers)
numbers_2 = list(range(1,21))
print(numbers_2
#4.4 a million
a_million_list = []
for number in range(1,10000001)
a_million_list.append(number)
print(a_million_list)
#4.5 calculating the sum of a million
a_million = list(range(1,10000001))
print(min(a_million))
print(max(a_million))
print(sum(a_million)
#4.6 odd number
odd_number = []
for odd in range(1,20,2):
odd_number.append(odd)
print(odd_number
#4.7 the truple of 3
truple_of_three = []
for truple in range(3,31,3):
truple_of_three.append(truple)
print(truple_of_three
#4.8 cube
list_of_cube = []
for cube in range(1,11):
list_of_cube.append(cube**3)
print(list_of_cube
#4.9 cubic parsing
list_of_cube_of_10 = [value**3 for value in range(1,11)]
print(list_of_cube_of_10
#4.10 slice
pizzas = ['durian', 'fruit', 'sausage', 'beef', 'pepperoni']
print("The first three items in the list are: ")
print(pizzas[0:4])
print("Three items from the middle of the list are: ")
print(pizzas[1:4])
print("The last three items in the list are: ")
print(pizzas[-3:]
#4.11 your pizzas and my pizzas
friend_pizzas = pizzas[:]
pizzas.append("pork")
friend_pizzas.append("apple")
print("My favorite pizzas are: ")
for pizza in pizzas:
print(pizza.title())
print("\nMy friend's favorite pizzas are: ")
for friend in friend_pizzas:
print(friend.title())
#4.12 using multiple loop
#unnecessarily to do so, repeatitive work.
#4.13 buffet
foods = ('beef', 'lamb', 'vegetable', 'apple', 'banana')
for food in foods:
print(food)
print("\nThe original foods are: ")
print(foods)
foods = ('beef', 'lamb', 'chicken', 'grape', 'banana')
print("\nThe modified foods are: ")
for food in foods:
print(food)