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

Python job 1

編輯:Python

One . Single topic selection

  1. ( Single topic selection , 3 branch ) It is known that x = 3; y = 4, Compound assignment statement x *= y + 5 After execution ,x The value in the variable is ?
    A. 23
    B. 24
    C. 27
    D. 17

  2. ( Single topic selection , 3 branch ) If there is a string s=‘a\nb\tc.’, be len(s) The value of is ?
    A. 8
    B. 7
    C. 6
    D. 5

  3. ( Single topic selection , 3 branch ) In the following options , Do not belong to Python The characteristic is ?
    A. object-oriented
    B. portable
    C. High operational efficiency
    D. Free and open source

  4. ( Single topic selection , 3 branch ) The following Python In the sentence , Illegal ?
    A. x = y = 1
    B. x = (y=1)
    C. x, y = y, x
    D. x = 1; y = 1

  5. ( Single topic selection , 3 branch ) stay Python in , Write multiple statements on one command line , Use... Between statements ____ separate .
    A. :
    B. /
    C. ;
    D. #

  6. ( Single topic selection , 3 branch ) The following program calculates two numbers x and y Big numbers in , Which is not true ?
    A. maxNum = x if x > y else y
    B. maxNum = math.max(x,y)
    C.
    if(x>y):maxNum=x
    else: maxNum=y
    D.
    if(y>=x):maxNum=y
    maxNum = x

  7. ( Single topic selection , 3 branch ) Perform the following Python The result of the statement is :
    i = 1
    if(i):print(True)
    else:print(False)
    A. Output 1
    B. Output True
    C. Output False
    D. Compile error

  8. ( Single topic selection , 3 branch )
    The output of the following code is ?
    x=2;y=2.0
    if(x==y):print(“Equal”)
    else:print(“Not Equal”)
    A. Equal
    B. Not Equal
    C. Compile error
    D. Runtime error

  9. ( Single topic selection , 3 branch ) In the following expression , It's not worth it 1 Yes. ?
    A. 4//3
    B. 15%2
    C. 1^0
    D. ~1

  10. ( Single topic selection , 3 branch ) The legal ones in the following identifiers are ?
    A. i’m
    B. _
    C. 3Q
    D. for

Two . Completion

  1. expression “[3] in [1, 2, 3, 4]” The value of is ___False__.

  2. Python The statement uses the symbol ____#___ Make a single line comment .

  3. sentence print(‘aaa’,‘bbb’,sep=‘-’,end=‘+’) The result of the implementation of ?
    aaa-bbb+

  4. Python Use __and___,or_,__not___ To express and respectively 、 or 、 Not .

  5. Python sentence a,b=3,4;a,b=b,a;print(a,b) The result is _4 3_____.

  6. Python Provides object comparison operators __is and is not __ To test whether two variables point to the same object ; With built-in functions __type()__ To test the type of object ; adopt __ ==___ Operator to determine whether the value of the object pointed to by two variables is the same .

  7. Python expression 12/4-2+5*8/4%5/2 The value of is __ 1.0 ____.

  8. Please write out Python Statement output :print(“{:#>12s}:{:*<9.2f}”.format(“Length”,23.87501))
    ######Length:23.88****


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