PYTHON测试题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
PYTHON测试题
A.defines a list and initializes it
B.defines a function, which does nothing
C.defines a function, which passes its parameters through
D.defines an empty class
A.
B.
C.
D.
E.
A.
B.
C.
D.
E.
A.
B.
C.
D.
E.
A.
B.
C.
D.
E.
A.
B.
C.
D.
E.
A.syntax error
B.4
C.5
D.6
E.7
A.
B.
C.
D.
E.
A.7
B.12
C.24
D.36
E.48
A.2.0
B.2.25
C.9.0
D.20.25
E.21
A.1
B.2
C.4
D.5
E.7
A.yes
B.no
C.fails to compile
A.1
B.3
C.4
D.7
E.none of the above
19. What gets printed?(C)
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
20.What gets printed?(B)
A.on one line the text: hello world
B.on one line the text: helloworld
C.hello on one line and world on the next line
D.syntax error, this python program will not run
21.What gets printed?(E)
A.\x48\x49!
B.4849
C.4849!
D. 48 49!
E.HI!
22. What gets printed?(D)
A.0xA + 0xa
B.0xA 0xa
C.14
D.20
E.0x20
23. What gets printed?(E)
A.None None
B.None 11
C.11 None
D.11 11
E.Error is generated by program
24. What gets printed?(E)
er
B.bill
C.password
D.hillary
E.Nothing. Python syntax error
25. What gets printed?(B)
A.None
B.123
C.666
D.SyntaxError, this program will not run
26. What gets printed?(C)
A.st
B.sto
C.to
D.tor
E.Syntax Error
27. What gets printed?(D)
A.snow storm
B.snowXstorm
C.snow Xtorm
D.ERROR, this code will not run
28. Which numbers are printed?(C)
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
29. What sequence of numbers is printed?(B)
A.1 2 3
B.1 2 1 3
C.1 2 1 3 1 2 1 3
D.1 1 1 1 2 2 3 3
E.Syntax Error
30. What sequence of numbers is printed?(E)
A.2 3 2 4
B.4 6 4 8
C.1 1.5 1 2
D.1 1 1 2