ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

Python 3 - Mock Test I

2022-04-01 21:31:28  阅读:236  来源: 互联网

标签:abcd 786 70.2 Python above Test 2.23 john Mock


 

Python 3 - Mock Test I

Q 1 - Which of the following is correct about Python?

A - Python is a high-level, interpreted, interactive and object-oriented scripting language.

B - Python is designed to be highly readable.

C - It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.

D - All of the above.

Q 2 - Which of the following is correct about Python?

A - It supports functional and structured programming methods as well as OOP.

B - It can be used as a scripting language or can be compiled to byte-code for building large applications.

C - It provides very high-level dynamic data types and supports dynamic type checking.

D - All of the above.

Q 3 - Which of the following is correct about Python?

A - It supports automatic garbage collection.

B - It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

C - Both of the above.

D - None of the above.

Q 4 - Which of the following environment variable for Python tells the Python interpreter where to locate the module files imported into a program?

A - PYTHONPATH

B - PYTHONSTARTUP

C - PYTHONCASEOK

D - PYTHONHOME

Q 5 - Which of the following environment variable for Python contains the path of an initialization file containing Python source code?

A - PYTHONPATH

B - PYTHONSTARTUP

C - PYTHONCASEOK

D - PYTHONHOME

Q 6 - Which of the following environment variable for Python is used in Windows to instruct Python to find the first case-insensitive match in an import statement?

A - PYTHONPATH

B - PYTHONSTARTUP

C - PYTHONCASEOK

D - PYTHONHOME

Q 7 - Which of the following environment variable for Python is an alternative module search path?

A - PYTHONPATH

B - PYTHONSTARTUP

C - PYTHONCASEOK

D - PYTHONHOME

Q 8 - Is python a case sensitive language?

A - true

B - false

Q 9 - Which of the following data types is not supported in python?

A - Numbers

B - String

C - List

D - Slice

Q 10 - Which of the following data types is not supported in python?

A - Tuple

B - Dictionary

C - Generics

D - List

Q 11 - What is the output of print str if str = 'Hello World!'?

A - Hello World!

B - Error

C - str

D - None of the above.

Q 12 - What is the output of print str[0] if str = 'Hello World!'?

A - Hello World!

B - H

C - ello World!

D - None of the above.

Q 13 - What is the output of print str[2:5] if str = 'Hello World!'?

A - llo World!

B - H

C - llo

D - None of the above.

Q 14 - What is the output of print str[2:] if str = 'Hello World!'?

A - llo World!

B - H

C - llo

D - None of the above.

Q 15 - What is the output of print str * 2 if str = 'Hello World!'?

A - Hello World!Hello World!

B - Hello World! * 2

C - Hello World!

D - None of the above.

Q 16 - What is the output of print list if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

A - [ 'abcd', 786 , 2.23, 'john', 70.2 ]

B - list

C - Error

D - None of the above.

Q 17 - What is the output of print list[0] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

A - [ 'abcd', 786 , 2.23, 'john', 70.2 ]

B - abcd

C - Error

D - None of the above.

Q 18 - What is the output of print list[1:3] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

A - [ 'abcd', 786 , 2.23, 'john', 70.2 ]

B - abcd

C - [786, 2.23]

D - None of the above.

Q 19 - What is the output of print list[2:] if list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]?

A - [ 'abcd', 786 , 2.23, 'john', 70.2 ]

B - abcd

C - [786, 2.23]

D - [2.23, 'john', 70.2]

Q 20 - What is the output of print tinylist * 2 if tinylist = [123, 'john']?

A - [123, 'john', 123, 'john']

B - [123, 'john'] * 2

C - Error

D - None of the above.

Q 21 - What is the output of print tinylist * 2 if tinylist = [123, 'john']?

A - [123, 'john', 123, 'john']

B - [123, 'john'] * 2

C - Error

D - None of the above.

Q 22 - Which of the following is correct about tuples in python?

A - A tuple is another sequence data type that is similar to the list.

B - A tuple consists of a number of values separated by commas.

C - Unlike lists, however, tuples are enclosed within parentheses.

D - All of the above.

Q 23 - What is the output of print list if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

A - ( 'abcd', 786 , 2.23, 'john', 70.2 )

B - tuple

C - Error

D - None of the above.

Q 24 - What is the output of print tuple[0] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

A - ( 'abcd', 786 , 2.23, 'john', 70.2 )

B - abcd

C - Error

D - None of the above.

Q 25 - What is the output of print tuple[1:3] if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

A - ( 'abcd', 786 , 2.23, 'john', 70.2 )

B - abcd

C - (786, 2.23)

D - None of the above.

Question NumberAnswer Key
1 D
2 D
3 C
4 A
5 B
6 C
7 D
8 A
9 D
10 C
11 A
12 B
13 C
14 A
15 A
16 A
17 B
18 C
19 D
20 A
21 A
22 D
23 A
24 B
25 C

REF

https://www.tutorialspoint.com/python3/python_mock_test.htm?min=1&max=25

 

标签:abcd,786,70.2,Python,above,Test,2.23,john,Mock
来源: https://www.cnblogs.com/emanlee/p/16088652.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有