4-2
animals=['dog','cat','cow']
for animal in animals:
print(animal)
print('A '+animal.title()+' would make a great pet.\n')
print('Any of these animals would make a great pet!\n')
4-5
array=[]
for value in range(1,1000001):
array.append(value)
print(min(array))
print(max(array))
print(sum(array))
4-10
array=['a','b','c','d','e']
print('The first three elements:')
print(array[0:3])
print('Three elements from middle of the list:')
print(array[1:4])
print('The last three elements of list:')
print(array[-3:])
![](https://i-blog.csdnimg.cn/blog_migrate/b2ce9a2aa4884d011d499e37421198cc.png)