程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python job 3

編輯:Python

One 、 choice question

  1. ( 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]

  2. ( 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]

  3. ( 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

  4. ( 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

  5. ( 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

  6. ( 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

  7. ( 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]))

  8. ( 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

  9. ( 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

  1. ( Single topic selection , 3 branch ) Variable parameters **kw Collect keyword parameters , And store these parameters in a _____ in .
    A. list
    B. Tuples
    C. Dictionaries
    D. Array

Two . Completion ( common 8 topic ,40 branch )

  1. ( 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 .

  2. ( 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]__.

  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__.

  4. ( 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’]____.

  5. ( Completion , 5 branch )Python sentence print(tuple(range(2)),list(range(2))) The result of the operation is __(0,1) [0,1]_.

  6. ( Completion , 5 branch )Python sentence fruits=[‘apple’,‘banana’,‘pear’];print(fruits[-1][-1]) The result is __r____.

  7. ( 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

  8. ( 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 ____


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved