wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Script_programming_test

Total questions: 25

Worksheet time: 25mins

Name
Class
Date
1.

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

a)

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

b)

B - Python is designed to be highly readable.

c)

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

d)

D - All of the above.

2.

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

a)

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)

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

d)

D - All of the above.

3.

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

a)

A - It supports automatic garbage collection.

b)

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

c)

C - Both of the above.

d)

D - None of the above.

4.

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)

A - PYTHONPATH

b)

B - PYTHONSTARTUP

c)

C - PYTHONCASEOK

d)

D - PYTHONHOME

5.

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

a)

A - PYTHONPATH

b)

B - PYTHONSTARTUP

c)

C - PYTHONCASEOK

d)

D - PYTHONHOME

6.

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)

A - PYTHONPATH

b)

B - PYTHONSTARTUP

c)

C - PYTHONCASEOK

d)

D - PYTHONHOME

7.

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

a)

A - PYTHONPATH

b)

B - PYTHONSTARTUP

c)

C - PYTHONCASEOK

d)

D - PYTHONHOME

8.

Q 8 - Is python a case sensitive language?

a)

A - true

b)

B - false

9.

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

a)

A - Numbers

b)

B - String

c)

C - List

d)

D - Slice

10.

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

a)

A - Tuple

b)

B - Dictionary

c)

C - Generics

d)

D - List

11.

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

a)

A - Hello World!

b)

B - Error

c)

C - str

d)

D - None of the above.

12.

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

a)

A - Hello World!

b)

B - H

c)

C - ello World!

d)

D - None of the above.

13.

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

a)

A - llo World!

b)

B - H

c)

C - llo

d)

D - None of the above.

14.

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

a)

A - llo World!

b)

B - H

c)

C - llo

d)

D - None of the above.

15.

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

a)

A - Hello World!Hello World!

b)

B - Hello World! * 2

c)

C - Hello World!

d)

D - None of the above.

16.

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

a)

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

b)

B - list

c)

C - Error

d)

D - None of the above.

17.

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

a)

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

b)

B - abcd

c)

C - Error

d)

D - None of the above.

18.

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

a)

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

b)

B - abcd

c)

C - [786, 2.23]

d)

D - None of the above.

19.

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

a)

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

b)

B - abcd

c)

C - [786, 2.23]

d)

D - [2.23, 'john', 70.2]

20.

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

a)

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

b)

B - [123, 'john'] * 2

c)

C - Error

d)

D - None of the above.

21.

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

a)

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

b)

B - [123, 'john'] * 2

c)

C - Error

d)

D - None of the above.

22.

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

a)

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

b)

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

c)

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

d)

D - All of the above.

23.

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)

B - tuple

c)

C - Error

d)

D - None of the above.

24.

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

a)

A - ′abcd ′ , 786, 2.23, ′ john ′ , 70.2

b)

B - abcd

c)

C - Error

d)

D - None of the above.

25.

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

a)

A - ′abcd ′ , 786, 2.23, ′ john ′ , 70.2

b)

B - abcd

c)

C - 786, 2.23

d)

D - None of the above.