One 、 choice question
( Single topic selection , 3 branch ) It is known that x=[1,2,3,4,5,6,7,8], perform x[1:-2] The result is _______.
A. [2, 3, 4, 5, 6]
B. [2, 3, 4, 5]
C. [2, 3, 4]
D. [3, 4, 5]
( Single topic selection , 3 branch )Python sentence s1=[4,5,6];s2=s1;s1[1]=0;print(s2) The result of the operation is ?
A. [4,5,6]
B. [0,5,6]
C. [4,0,6]
D. [4,6,0]
( Single topic selection , 3 branch )Python sentence nums=set([1,2,2,3,3,3,4]);print(len(nums)) The output of is ?
A. 1
B. 2
C. 4
D. 7
( Single topic selection , 3 branch ) What's wrong with the following statement is ()
A. Class is a template for an object , Objects are instances of classes
B. If the instance property name is only in __ It begins with but does not begin with __ End naming , It becomes a private variable
C. Private variables of a class can only be accessed inside the class , No access from outside
D. stay Python in , A subclass can only have one parent class
( Single topic selection , 3 branch ) The following statement about decorators is wrong ()
A. Decorators are functions that wrap functions
B. Decorators facilitate code reuse
C. Decorator must return a function object
D. A function can only be decorated with one decorator
( Single topic selection , 3 branch ) Which of the following is not sequence type data
A. character string str
B. list list
C. Tuples tuple
D. Dictionaries dict
( Single topic selection , 3 branch ) The following statement that cannot create a dictionary is ( )
A. dict1={}
B. dict2={3:5}
C. dict3=dict([1,2],[3,4])
D. dict4=dict(([5,6],[3,4]))
( Single topic selection , 3 branch )Python sentence print(r"\nGood") The result of the operation is ?
A. New lines and strings Good
B. r"\nGood"
C. r’\nGood’
D. \nGood
( Single topic selection , 3 branch ) The execution result of the following procedure is ()
class C():
f=10
class C1():
pass
print(C.f,C1.f)
A. 10 10
B. 10 pass
C. pass 10
D. Operation error
Two . Completion ( common 8 topic ,40 branch )
( Completion , 5 branch )Python The first parameter of a class method is generally __ self ___, This method is called the instance method , This parameter generally refers to the object instance itself ; The first parameter in the class method is ___cls_____ when , This method is called class method , This parameter generally refers to the class object itself .
( Completion , 5 branch ) expression dict(zip([3, 5], [6, 10])) The value of is __ {3: 6, 5: 10} _; expression list(map(lambda x: len(x), [‘a’, ‘bb’, ‘ccc’])) The value of is ___[1, 2, 3]__.
( Completion , 5 branch ) expression [1, 2] + [3] The value of is __ [1,2,3]_; expression (1,) + (2,) The value of is _(1, 2)_; expression (1) + (2) The value of is _3__.
( Completion , 5 branch ) stay Python in , Equipped with s=[‘a’,‘b’], Statement sequence "s.append([1,2]); s.extend(‘34’); s.extend([5,6]); s.insert(1,7); s.insert(10,8); s.pop(); s.remove(‘b’); s[3:]=[]; s.reverse()" After execution ,s The value is __[[1,2],7,‘a’]____.
( Completion , 5 branch )Python sentence print(tuple(range(2)),list(range(2))) The result of the operation is __(0,1) [0,1]_.
( Completion , 5 branch )Python sentence fruits=[‘apple’,‘banana’,‘pear’];print(fruits[-1][-1]) The result is __r____.
( Completion , 5 branch )Python It is usually agreed that : Start with two underscores , But the attributes that do not end with two underscores are __ private ;private_ attribute , For the other __ public ;private__ attribute
( Completion , 5 branch )jieba The library is used for __ Chinese word segmentation ; participle _,wordcloud The library is used for __ Generate the word cloud ; Generate word cloud ; Make word cloud ; Make a cloud of words ; Ci cloud production ; Draw word clouds ; Word cloud rendering ; Show word cloud ; Ci cloud show ____