01 exercises

For a list of names = [ 'Golden King angle', 'black girl', 'rain', 'eva', "dog egg ',' silver horn King ',' EVA ',' 'beheaded] into the following
 
1. Return the second method by eva names.index () value
names.index ( ' eva ' ) 

names.index ( ' eva ' index, 4, -1) of the second eva

2. The list above for reversing the way through slices

names[::-1]

3. Print a list of all index values ​​for the odd

print(names[1::2])

4. () method to find the values ​​of two eva names.index, and into which EVA

names[names.index('eva',4,-1)]='EVA'

 

Guess you like

Origin www.cnblogs.com/lily-88/p/10991889.html