【轉】python測試開發面試題


出處:http://my.oschina.net/u/1433482/blog/467954?fromerr=WrfxL2Kw

試卷時間 60分鍾,請不要在試卷上作答,用A4紙做答題紙作答。 

 


 

一,中文單項選擇題(30分,每個3分)

  • 1.下列哪個語句在Python中是非法的?

A、x = y = z = 1                 B、x = (y = z + 1)

C、x, y = y, x                        D、x  +=  y

  • 2.關於Python內存管理,下列說法錯誤的是

A、變量不必事先聲明          B、變量無須先創建和賦值而直接使用

C、變量無須指定類型         D、可以使用del釋放資源

  • 3、下面哪個不是Python合法的標識符

A、int32                 B、40XL         C、self                D、name

  • 4、下列哪種說法是錯誤的

A、除字典類型外,所有標准對象均可以用於布爾測試

B、空字符串的布爾值是False

C、空列表對象的布爾值是False

D、值為0的任何數字對象的布爾值是False

  • 5、下列表達式的值為True的是

A、5+4j > 2-3j                         B、3>2>2

C、(3,2) ‘xyz’

  • 6、Python不支持的數據類型有

A、char                 B、int                  C、float                 D、list

  • 7、關於Python中的復數,下列說法錯誤的是

A、表示復數的語法是real + image j   B、實部和虛部都是浮點數

C、虛部必須后綴j,且必須是小寫   D、方法conjugate返回復數的共軛復數

  • 8、關於字符串下列說法錯誤的是

A、字符應該視為長度為1的字符串                 B、字符串以標志字符串的結束

C、既可以用單引號,也可以用雙引號創建字符串   D、在三引號字符串中可以包含換行回車等特殊字符

  • 9、以下不能創建一個字典的語句是

A、dict1 = {}                        B、dict2 = { 3 : 5 }         C、dict3 = {[1,2,3]: “uestc”}         D、dict4 = {(1,2,3): “uestc”}

  • 10、下列Python語句正確的是

A、min = x  if  x y ? x : y

C、if (x > y)        print x         D、while True : pass

 

二,英文單項選擇題(30分)

  • 1.what gets printed? Assuming python version 2.x()

print type(1/2)

A. B. C. D. E.

  • 2. What gets printed?()

 

A.1 B.2 C.4 D.5 E.7

  • 3. What gets printed?()

A.1 B.3 C.4 D.7 E.none of the above

  • 4. What gets printed?()

 

A.new line then the string: woow

B.the text exactly like this: r”nwoow”

C.the text like exactly like this: nwoow

D.the letter r and then newline then the text: woow

E.the letter r then the text like this: nwoow

  • 5. Which numbers are printed?()

 

A.2, 4, 6 B.0, 1, 2, 4, 5, 6 C.0, 1, 4, 5 D.0, 1, 4, 5, 6, 7, 8, 9 E.1, 2, 4, 5, 6

  • 6. What gets printed by the code snippet below?()

 

A.5 B.5.0 C.5.5 D.6 E.6.0

  • 7. Assuming the filename for the code below is /usr/lib/python/person.py

and the program is run as: python /usr/lib/python/person.py

What gets printed?()

A.Person B.getAge C.usr.lib.python.person D.main E.An exception is thrown

  • 8. What gets printed?()

A.1 B.2 C.An exception is thrown

  • 9.  What gets printed?()

A.4 B.5 C.8 D.12 E.An exception is thrown

  • 10. What gets printed?()

A.1 B.2 C.6 D.10 E.An exception is thrown

 

三,shell筆試題(15分)

文件如下:

請打印出用戶目錄在/home下面的的用戶目錄,如下

建議一行搞定。

 

四,SQL筆試題(15分)

用一條SQL語句 查詢出每門課都大於80分的學生姓名 。表scores如下:

name   kecheng   fenshu

張三     語文       81

張三     數學       75

李四     語文       76

 

五,python筆試題(20分)

    • 1,python常見的命令行交互自動化模塊有哪些?(2分)
    • 2,python的底層網絡交互模塊有哪些?(2分)
    • 3,python網絡交互時,二進制打包解包的模塊有哪些(2分)
    • 4,python的測試框架有哪些?試列出常用的3個或更多(6分)
    • 5,一行把[1,2,3,1,2,3] 中的重復元素剔除。(3分)
    • 6,現在要你使用pyDes(DES加密)和標准庫中的namedtuple,假設你之前沒有接觸過,你如何快速上手? (5分)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM