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

Python job 2

編輯:Python

One . Single topic selection

  1. ( Single topic selection ) Among the following data types ,Python What is not supported is _______.
    A. int
    B. float
    C. char
    D. list

  2. ( Single topic selection )Python sentence "f1=lambda x:x*2; f2=lambda x:x**2; print(f1(f2(2)))" The result of the program is ________
    A. 2
    B. 4
    C. 6
    D. 8

  3. ( Single topic selection )Python in , if def f1(p,**p2):print(type(p2)), be f1(1,a=2) The result of the program is _______.
    A. <class ‘int’>
    B. <class ‘type’>
    C. <class ‘dict’>
    D. <class ‘list’>

  4. ( Single topic selection ) Which of the following are mutable objects ?
    A. int
    B. str
    C. list
    D. float

  5. ( Single topic selection ) In the following options , And s[0:-1] Means the same as ______.
    A. s[-1]
    B. s[:]
    C. s[:len(s)-1]
    D. s[0:len(s)]]

  6. ( Single topic selection )Python For expressions in programs 123+‘XYZ’, The interpreter will throw ______ error message .
    A. NameError
    B. FileNotFoundError
    C. SyntaxError
    D. TypeError

  7. ( Single topic selection ) The following description of the string is wrong ()
    A. character string s The first character of is s[0]
    B. In the string , The size of the same letter is equivalent
    C. The characters in the string are stored and processed in some binary encoding way
    D. String can also be used for relation comparison

  8. ( Single topic selection ) The following is about exception handling try Statement block statement , What's not right is _______.
    A. finally The code in the statement must always be executed
    B. One try A block is followed by one or more except block
    C. One try A block is followed by one or more finally block
    D. try The block must be the same as except or finally Use blocks together

  9. ( Single topic selection ) In the following options , What is wrong with the function definition is _______.
    A. def myfunc(a,b)
    B. def myfunc(a,*b)
    C. def myfunc(*a,b)
    D. def myfunc(a,b=2)

  10. ( Single topic selection )
    In the following expression , Can be used to determine the string s1 Whether it belongs to string s( namely s1 whether s The string of ) Yes. ( ).
    ①s1 in s;②s.index(s1)>0; ③s.find(s1)>0;④s.rfind(s1)>0;⑤s.rindex(s1)>0
    A. ①②
    B. ①②③
    C. ①②③④
    D. ①②③④⑤
    Two . Completion

  11. ( Completion )Python expression 10+5//3-True+False The value of is ___ 10 _____.

  12. ( Completion ) expression chr(ord(‘a’)-32) The value of is ____A_______.

  13. ( Completion ) Mathematical expression
    Of Python Expression for :__math.sin(15math.pi/180)+(math.pow(math.e,x)-5x)/math.sqrt(xx+1)-math.log(3x);____.

math.sin(15math.pi/180)+(math.pow(math.e,x)-5x)/math.sqrt(xx+1)-math.log(3x);
from math import *
sin(pi/12) + (ex -5x) / sqrt(xx + 1) - log(3x);
math.sin(15
math.pi/180)+(math.exp(x)-5*×)/math.sqrt(x
2+1)-math.log(3x);
from math import *
sin(radians(15))+(pow(e,x)-5
x)/(sqrt(x2+1))-log(3*x,e);
math.sin(math.pi/12)+((math.e
x-5x)/math.sqrt(x**2+1))- math.log(math.e,3x);
math.sin(15math.pi/180)+(math.exp(x)-5x)/math.sqrt(x2+1)-math.log(3x);
math.sin(15/180
math.pi)+(math.exp(x)-5*x)/math.sqrt(x
2+1)-math.log(math.e,3x);
math.sin(math.pi
15/180) + ((math.exp(x) - 5x)/math.sqrt(x**2 + 1)) - math.log(3x);
math.sin(math.pi15/180) + (math.exp(x) - 5x)/math.sqrt(x**2 + 1) - math.log(3x);
sin(15
math.pi/180)+(math.pow(math.e,x)-5x)/math.sqrt(xx+1)-math.log(3*x);

  1. ( Completion ) In rectangular coordinates ,x,y Is the position of any point in the coordinate system , use x and y Representing the first or second quadrant Python Expression for ____x>0______.

x>0 and y>0 or x<0 and y>0;
x>0 and y>0 or x<0 and y>0;
(x>0 and y>0) or (x<0 and y>0);
x!=0 and y>0;
x!=0 and y>0;
y>0 and x!=0;
(x<0 and y>0) or (x>0 and y>0)

  1. ( Completion ) It is known that x = [5, 6, 7], Then execute the statement x[:3] = [8] after ,x The value of is ______ [8] _____ ; Execute the statement at this time x[3:] = [9] after ,x The value of is ___ [8,9] ___.

  2. ( Completion ) stay python in , Use built-in functions ___ locals() ___ and ____globals()___, You can view and output a list of local and global variables .

  3. ( Completion ) It is known that arr = [[3,4], [8,9]], Expression [col for row in arr for col in row] The value of is ___[3, 4, 8, 9]____.

  4. ( Completion ) expression {1, 2, 3} & {2, 3, 4} The value of is ____{2,3} ____ ; expression {1, 2, 3} - {3, 4, 5} The value of is __ {1,2} ____.


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