#Exer 5.7 import numpy as np w = np.linspace(0,3,31) """ Slicing of lists and arrays: w[start:stop:step], where start,stop,step and the last : are optional """ print('w[:] \n', w[:]) print('w[:-2] \n',w[:-2]) print('w[::5] \n',w[::5]) print('w[2:-2:6] \n',w[2:-2:6]) """ Terminal> python slicing.py w[:] [0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3. ] w[:-2] [0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8] w[::5] [0. 0.5 1. 1.5 2. 2.5 3. ] w[2:-2:6] [0.2 0.8 1.4 2. 2.6] """