已知pets = [‘ant’, ’dog’, ’cat’, ’bird’],要对该列表中的元素排序应该使用下列哪个方法?
A: pets.sort( )
B: pets.reverse( )
C: pets.extend( )
D: pet.insert( )
A: pets.sort( )
B: pets.reverse( )
C: pets.extend( )
D: pet.insert( )
举一反三
- 命令:>;>;>;pets=('dog','cat','bird','dog')>;>;>;pets.index('dog')执行结果为: A: 0 B: 1 C: 2 D: 3
- More than 60% of American families have a pet, and keeping pets is expensive.
- The pets have to travel in _________ .
- Some people love pets and regard them as friends ________ other people dislike pets and think they may cause diseases.
- These pets ______ a lot of care and attention.