wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

12_comp_sci_onewordTest

Total questions: 155

Worksheet time: 1hrs 18mins

Name
Class
Date
1.

The small sections of code that are used to perform a particular task is called

a)

Subroutines

b)

Files

c)

Pseudo code

d)

Modules

2.

Which of the following is a unit of code that is often defined within a greater code structure?

a)

Subroutines

b)

Function

c)

Files

d)

Modules

3.

Which of the following is a distinct syntactic block?

a)

Subroutines

b)

Function

c)

Definition

d)

Modules

4.

The variables in a function definition area called as

a)

Subroutines

b)

Function

c)

Definition

d)

Parameters

5.

The values which are passed to a function definition are called

a)

Arguments

b)

Subroutines

c)

Function

d)

Definition

6.

Which of the following are mandatory to write the type annotations in the function definition?

a)

{ }

b)

( )

c)

[ ]

d)

< >

7.

Which of the following definies what an object can do?

a)

Operating system

b)

Compiler

c)

Interface

d)

Interpreter

8.

Which of the following carries out the instructions defined in the interface?

a)

Operating System

b)

Compiler

c)

Implementation

d)

Interpreter

9.

The function which will give exact result when same arguments are passed are called

a)

Impure function

b)

Partial function

c)

Dynamic Functions

d)

Pure function

10.

The funtion which cause side effects to the arguments passed are called

a)

Impure function

b)

Partial function

c)

Dynamic function

d)

Pure function

11.

Which of the following functions that build the abstract data type>

a)

Constructors

b)

Destructors

c)

recursive

d)

nested

12.

Which of the following functions that retrieve information from the data type?

a)

Constructors

b)

Selectors

c)

recursive

d)

Nested

13.

The data structure which is a mutable ordered sequence of elements is called

a)

Built in

b)

list

c)

tuple

d)

derived data

14.

A sequence of immutable objects is called

a)

Built in

b)

list

c)

Tuple

d)

Derived data

15.

The data type whose representation is known are called

a)

Built in datatype

b)

Derived Datatype

c)

Concrete datatype

d)

Abstract datatype

16.

The data type whose representation is unknown are called

a)

Built in datatype

b)

Derived datatype

c)

concrete datatype

d)

Abstract datatype

17.

Which of the following is a compound structure?

a)

Pair

b)

Triplet

c)

Single

d)

Quadrat

18.

Bundling two values together into one can be considered as

a)

Pair

b)

Triplet

c)

Single

d)

quadrat

19.

Which of the following allow to name the various parts of a multi item object?

a)

Tuples

b)

lists

c)

Classes

d)

Quadrats

20.

Which of the following is constructed by placing expressions within square brackets?

a)

Tuples

b)

Lists

c)

Classes

d)

quadrats

21.

Which of the following refers to the visibility of variables in one part of a program to another part of the same program

a)

scope

b)

memory

c)

address

d)

accessibility

22.

The process of binding a variable name with an object is called

a)

scope

b)

mapping

c)

late binding

d)

early binding

23.

Which of the following is used in programming languages to map the variable and object?

a)

::

b)

:=

c)

=

d)

==

24.

containers for mapping names of variables to objects is called

a)

scope

b)

mapping

c)

binding

d)

namespaces

25.

Which scope refers to variables defined in current function?

a)

Local scope

b)

Global scope

c)

Module scope

d)

Function scope

26.

The process of subdividing a computer program into separate sub programs is called

a)

Procedural programming

b)

modular programming

c)

Event driven programming

d)

Object oriented programming

27.

Which of the following security technique that regulates who cause resources in a computing environment

a)

Password

b)

Authentication

c)

Access Control

d)

Certification

28.

Which of the following members of a class can be handled only form within the class?

a)

Public members

b)

Protected members

c)

Secured members

d)

Private members

29.

Which members are accessible from outside the class?

a)

Public members

b)

Protected members

c)

Secured members

d)

Private members

30.

The members that are accessible from within the class and are also available to its subclasses is called

a)

public members

b)

protected members

c)

secured members

d)

protected members

31.

The word comes from the name of a Persian mathematician Abu Ja'far Mohammed ibn-i-Musa al Khowarizmi is called?

a)

Flowchart

b)

Flow

c)

Algorithm

d)

Syntax

32.

From the following sorting algorithms which algorithm which algorithm needs the minimum number of swaps?

a)

Bubble sort

b)

Insertion sort

c)

Selection Sort

d)

All the above

33.

Two main measures for the efficiency of an algorithm are ___

a)

Processor and memory

b)

Complexity and capacity

c)

Time and space

d)

Data and space

34.

The algorithm that yields expected output for a valid input in called as __

a)

Algorithm solution

b)

algorithm outcomes

c)

algorithmic problem

d)

algorithmic coding

35.

Which of the following is used to describe the worst case of an algorithm?

a)

Big A

b)

Big S

c)

Big W

d)

Big O

36.

Big Ω is the reverse of

a)

Big O

b)

Big Θ

c)

Big A

d)

Big S

37.

Binary search is also called as

a)

Linear search

b)

Sequencial search

c)

Random Search

d)

Half- Internal Search

38.

The Θ notation in asymptotic evaluation represents

a)

Base case

b)

Average case

c)

Worst case

d)

Null case

39.

If a problem can be broken into subproblems which are reused several times, the problem possesses which property?

a)

Overlapping subproblems

b)

Optimal substructure

c)

Memization

d)

Greedy

40.

In dynamic programming, the technique of storing the previously calculated values is called?

a)

Saving value property

b)

Storing value property

c)

Memoization

d)

Mapping

41.

Who developed python?

a)

Ritche

b)

Guido van Rossum

c)

Bill Gates

d)

Sunder Pitchai

42.

The Python prompt indicates that interpreter is ready to accept instruction.

a)

>>>

b)

<<<

c)

#

d)

<<

43.

Which of the following shortcut is used to create new python program?

a)

Ctrl + C

b)

Ctrl + F

c)

Ctrl + B

d)

Ctrl + N

44.

Which of the following character is used to give comments in python program?

a)

#

b)

&

c)

@

d)

$

45.

This symbol is used to print more than one item on a single line.

a)

;

b)

$

c)

,

d)

:

46.

Which of the following is not a token?

a)

interpreter

b)

identifier

c)

keyword

d)

operators

47.

Which of the following is not a keyword in python?

a)

Break

b)

While

c)

Continue

d)

Operators

48.

Which operator is also called as comparitive operator?

a)

Arithmetic

b)

Relational

c)

Logical

d)

Assignment

49.

Which of the following is not Logical operator?

a)

and

b)

or

c)

not

d)

assignment

50.

Which operator is also called as conditional operator?

a)

Ternary

b)

Relational

c)

logical

d)

Assignment

51.

How many important control structures are there in python?

a)

3

b)

4

c)

5

d)

6

52.

elif can be considered to the abbreviation of

a)

nested if

b)

if...else

c)

else... if

d)

if...elif

53.

What plays a vital role in python programming ?

a)

statements

b)

control

c)

structure

d)

indentation

54.

Which statement is generally used as a placeholder?

a)

continue

b)

break

c)

pass

d)

goto

55.

The condition in the if statement should be in the form of

a)

arithmetic or relational expression

b)

arithmetic or logical expression

c)

relational or logical expression

d)

arithmetic

56.

Which of the following is known as definite loop?

a)

do...while

b)

While

c)

for

d)

if...elif

57.

What is output of the following snippet?

i=1
while True:
if i%3 ==0:

break

print(i,end='')

i+=1

a)

12

b)

123

c)

1234

d)

124

58.

What is the output of the following snippet?
T=1
while T:
print(True)
break

a)

False

b)

True

c)

0

d)

1

59.

Which amongst this is not a jump statement?

a)

for

b)

pass

c)

continue

d)

break

60.

Which punctuation should be used in the blank?
if<condition> _
statement-block 1

else:

statement block 2

a)

;

b)

:

c)

::

d)

!

61.

A named blocks of code that are designed to do one specific job is called as

a)

Loop

b)

Branching

c)

Function

d)

Block

62.

A function which calls itself is called as

a)

Built-in

b)

Recursion

c)

Lambda

d)

return

63.

Which function is called anonymous un-named function

a)

Lambda

b)

Recursion

c)

Function

d)

define

64.

Which of the following keyword is used to begin the function block?

a)

define

b)

for

c)

finally

d)

def

65.

Which of the following keyword is used to exit a function block?

a)

define

b)

return

c)

finally

d)

def

66.

while defining a function which of the following symbol is used

a)

;

b)

.

c)

:

d)

$

67.

In which arguments the correct positional order is passed to a function?

a)

required

b)

keyword

c)

default

d)

variable length

68.

Read the following statement and choose the correct statement(s).
(i) In python, you don't have to mention the specific data types while defining function.
(ii) python keywords can be used as function name

a)

I is correct and II is wrong

b)

Both are correct

c)

I is wrong and II is correct

d)

Both are wrong

69.

Pick the correct one to execute the given statement successfully
if ____: print(x,"is a leap year")

a)

x%2=0

b)

x%4==0

c)

x/4=0

d)

x%4=0

70.

Which of the following keyword is used to define the function testpython():?

a)

define

b)

pass

c)

def

d)

while

71.

Which of the following is the output of the following python code?
str1="TamilNadu"
print(str1[::-1]

a)

Tamilnadu

b)

Tmlau

c)

udanlimaT

d)

udaNlimaT

72.

What will be the output of the following code?
str1="Chennai Schools"
str1[7]="-"

a)

chennai-schools

b)

chenn-School

c)

Type error

d)

Chennai

73.

Which of the following operator is used for concatenation?

a)

+

b)

&

c)

*

d)

=

74.

Defining strings within triple quotes allows creating:

a)

single line strings

b)

Multiline Strings

c)

Double line Strings

d)

Multiple strings

75.

Strings in python:

a)

Changeable

b)

Mutable

c)

Immutable

d)

flexible

76.

Which of the following is the slicing operator?

a)

{ }

b)

[ ]

c)

< >

d)

( )

77.

What is stride?

a)

index value of slide operation

b)

first argument of slice operation

c)

second argument of slice operation

d)

third argument of slice operation

78.

Which of the following formatting character is used to print expnential notation in upper case?

a)

%f

b)

%E

c)

%g

d)

%n

79.

Which of the following is used as placeholder or replacement fields which get replaced along with format() function ?

a)

{ }

b)

< >

c)

++

d)

^^

80.

The subscript of a string may be:

a)

positive

b)

negative

c)

both a and b

d)

either a or b

81.

Pick odd one in connection with collection data type.

a)

list

b)

tuple

c)

Dictionary

d)

loop

82.

Let list1=[2,4,6,8,10], then print(list1[-2]) will result in

a)

10

b)

8

c)

4

d)

6

83.

Which of the following function is used to count the number of elements in a list?f

a)

count( )

b)

find( )

c)

len( )

d)

index( )

84.

if List=[17,23,41,10] then List.append(32) will result

a)

[32,17,23,41,10]

b)

[17,23,41,10,32]

c)

[10,17,23,32,41]

d)

[41,32,23,17,10]

85.

Which of the following python function can be used to add more than one element within an existing list?

a)

appent( )

b)

append_more( )

c)

extend( )

d)

more( )

86.

if List=[10,20,30,40,50] then List[2]=35 will result

a)

[35,10,20,30,40,50]

b)

[10,20,30,40,50,35]

c)

[10,20,35,40,50]

d)

[10,35,30,40,50]

87.

What will be teh result of the following python code
s=[x**2 for x in range(5)]
print(s)

a)

[0,1,2,4,5]

b)

[0,1,4,9,16]

c)

[0,1,4,9,16,25]

d)

[1,4,9,16,25]

88.

What is the use of type( ) function in python?

a)

to create a Tuple

b)

To know the type of an element in tuple

c)

To know the data type of python object

d)

to create a list

89.

Which of the following statement is not correct?

a)

A list is mutable

b)

A tuple is immutable

c)

The append( ) function is used to add an element

d)

The extend( ) function is used in tuple to add elements in a list

90.

Let set A={3,6,9}, set B={1,3,9} what will be the result of the following snippet?
print(setA | setB)

a)

{3,4,9,1,3,9}

b)

{3,9}

c)

{1}

d)

{1,3,6,9}

91.

Which of the following set operation includes all the elements that are in two sets but not the one that are common to two sets?

a)

Symmetric difference

b)

Difference

c)

Intersection

d)

Union

92.

The keys in python, dictinary is specified by

a)

=

b)

;

c)

+

d)

:

93.

Which of the following are the key features of an object oriented programming language?

a)

constructor and classes

b)

constructor and object

c)

classes and objects

d)

constructor and destructor

94.

Functions defined inside a class

a)

functions

b)

module

c)

methods

d)

section

95.

class members are accessed through which operator?

a)

&

b)

.

c)

#

d)

%

96.

Which of the following method is automatically executed when an object is created?

a)

__object__()

b)

__del__()

c)

__func_ _()

d)

__init _ _()

97.

Which of the following method is used as destructor?

a)

-- init --()

b)

__dest _ _()

c)

__ rem _ _()

d)

__ del _ _ ()

98.

A private class variable is prefixed with

a)

__

b)

&&

c)

##

d)

**

99.

Which of the following class declaration is correct?

a)

class class_name

b)

class class_name<>

c)

class class_name:

d)

class class_name[ ]

100.

Which of the following is the output of the following program?
class student:
def __int _ _(self,name):
self.name=name
print(self.name)
S=Student("Tamil")

a)

Error

b)

Tamil

c)

name

d)

self

101.

Which of the following is the private class variable?

a)

__num

b)

##num

c)

$$num

d)

&&num

102.

The process of creating an object is called as

a)

constructor

b)

destructor

c)

initialize

d)

instantiation

103.

What is the acronym of DBMS?

a)

DataBase Management symbol

b)

Database Managing System

c)

DataBase Management system

d)

DataBasic Management system

104.

A table is known as

a)

tuple

b)

attribute

c)

relation

d)

entity

105.

Which database model represents parent-child relationship?

a)

Relational

b)

Network

c)

Hierarchical

d)

Object

106.

Relational database model was first proposed by

a)

E F codd

b)

E E codd

c)

E F cadd

d)

E F codder

107.

What type of relationship does hierarchical model represents?

a)

one-to-one

b)

one-to-many

c)

many-to-one

d)

many-to-many

108.

Who is called Father of Relational Database from the following?

a)

Chris Date

b)

Hugh Darween

c)

Edgar Frank Codd

d)

Edgar Frank Cadd

109.

Which of the following is an RDBMS?

a)

Dbase

b)

Foxpro

c)

Microsoft Access

d)

Microsoft Excel

110.

What symbol is used for SELECT statement?

a)

𝜎

b)

π

c)

X

d)

Ω

111.

A tuple is also known as __

a)

table

b)

row

c)

attribute

d)

field

112.

Who developed ER model?

a)

Chen

b)

EF Codd

c)

Chend

d)

Chand

113.

Which commands provide definitions for creating table structuer, deleting relations,a nd modifying relation schemas.

a)

DDL

b)

DML

c)

DCL

d)

DQL

114.

Which command lets to change the structure of the table?

a)

SELECT

b)

ORDER BY

c)

MODIFY

d)

ALTER

115.

The command to delete a table including the structure is

a)

DROP

b)

DELETE

c)

DELETE ALL

d)

ALTER TABLE

116.

Queries can be generated using

a)

SELECT

b)

ORDER BY

c)

MODIFY

d)

ALTER

117.

The clause used to sort data in a database

a)

SORT BY

b)

ORDER BY

c)

GROUP BY

d)

SELECT

118.

A CSV file is also known as a

a)

Flat file

b)

3D file

c)

String file

d)

Random file

119.

The expansion of CRLF is ___

a)

Control return and line feed

b)

Carriage return and form feed

c)

Control Router and line feed

d)

Carriage Return and line feed

120.

Which of the following mode is used when dealing with non-text files like image or exe files?

a)

Text mode

b)

Binary mode

c)

xls mode

d)

csv mode

121.

Which of the following module is provided by python to do several operations on the CSV files?

a)

py

b)

xls

c)

csv

d)

os

122.

The command used to skip a row in a CSV file is

a)

next( )

b)

skip( )

c)

omit( )

d)

bounce( )

123.

Which of the following is a string used to terminate lines produced by writer( ) method of csv modules?

a)

Line Terminator

b)

Enter key

c)

Form Feed

d)

Data Terminator

124.

What is the output of the following program? import csv
d=csv.reader(open('c\pyprg\ch13\city.csv'))
next(d)
for row in d:
print(row)
if the file called "city.csv" contain the following details chennai,mylapore mumbai,andheri




a)

chennai,mylapore

b)

mumbai,andheri

c)

chennai
mumba

d)

Chennai,mylapore
mumbai, andheri

125.

Which of the following creates an object which maps data to a dictionary?

a)

listreader( )

b)

reader( )

c)

typlereader( )

d)

DictReader( )

126.

Making some changes in the data of the existing file or adding more data is called

a)

Editing

b)

Appending

c)

Modification

d)

Alteration

127.

import csv
d=[['exam'],['quarterly'],['halfyearly']] csv.register_dialect('M',lineterminator='\n')
with open('c:\pyprg\ch13\line2.csv','w')as f:
wr=csv.writer(f,dialect='M') wr.writerrows(D)
f.close()

a)

Exam Quarterly Halfyearly

b)

Exam Quarterly Halfyearly

c)

E
Q
H

d)

Exam,
Quarterly
Halfyearly

128.

Which of the following is not a scripting language?

a)

Javascript

b)

PHP

c)

Perl

d)

HTML

129.

Importing C++ program in a python program is called

a)

Wrapping

b)

Downloading

c)

Interconnecting

d)

Parsing

130.

The expansion of API is

a)

Application Programming Interpreter

b)

Application Programming Interface

c)

Application Performing Interface

d)

Application Programming Interlink

131.

A framework for interfacing python and C++ is

a)

ctypes

b)

SWIG

c)

Cython

d)

Boost

132.

Which of the following is a software design technique to split your code into separate parts?

a)

Object oriented programming

b)

Modular programming

c)

Low level programming

d)

Procedure oriented programming

133.

The module which allows you to interface with the windows operating system is

a)

OS module

b)

sys module

c)

csv module

d)

getopt module

134.

getopt( ) will return an empty array if there is no error in splitting strings to

a)

argv variable

b)

opt variable

c)

args variable

d)

ifile variable

135.

identify the function call statement in the following snippet
if __name__=='__main__':
main(sys.argv[1:]

a)

main(sys.argv[1:]

b)

__name_ _

c)

__main _ _

d)

argv

136.

Which of the following can be used for processing text, numbers, images and scientific data?

a)

HTML

b)

C

c)

C++

d)

PYTHON

137.

What does the __ name __contains?

a)

c++ file name

b)

main() name

c)

python filename

d)

os module name

138.

Which of the following is an organized collection of data?

a)

Database

b)

DBMS

c)

Information

d)

Records

139.

SQLite falls under which database system?

a)

Flat file database system

b)

Relational database system

c)

Hierarchical database system

d)

object oriented Database system

140.

Which of the following is a control structure used to traverse and fetch the records of the database?

a)

pointer

b)

key

c)

cursor

d)

insertion point

141.

Any changes made in the values of the record should be saved by the command

a)

save

b)

save as

c)

commit

d)

oblige

142.

Which of the following executes the SQL command to perform some action?

a)

execute( )

b)

key( )

c)

cursor( )

d)

run( )

143.

Which of the following function retrieves the average of a selected column of rows in a table?

a)

Add( )

b)

SUM( )

c)

AVG( )

d)

AVERAGE( )

144.

The function that returns the largest value of the selected column is

a)

MAX( )

b)

LARGE( )

c)

HIGH( )

d)

MAXIMUM( )

145.

Which of the following is called the master table?

a)

sqlite_master

b)

sql_master

c)

main_master

d)

master_main

146.

Which of the following keyword avoid the duplicate?

a)

Distinct

b)

Remove

c)

Where

d)

GroupBY

147.

Which is a python package used for 2D charts?

a)

matplotlib.pyplot

b)

matplotlib.pip

c)

matplotlib.numpy

d)

matplotlib.plt

148.

Identify the package manager for installing python packages or modules.

a)

matplotlib

b)

PIP

c)

plt.show( )

d)

python package

149.

Which of the following feature is used to represent data and information graphically?

a)

Data list

b)

Data Tuple

c)

Classes and objects

d)

Data Visualization

150.

__ is a collection of resources assembled to create a single unified visual display.

a)

interface

b)

Dashboard

c)

Objects

d)

Graphics

151.

Which of the following module should be imported to visualize data and information in python?

a)

csv

b)

getopt

c)

mysql

d)

matplotlib

152.

__ is a type of chart which displays information as a series of data points connected by straight line segments

a)

csv

b)

pie chart

c)

bar chart

d)

line chart

153.

(a) import matplotlib.pyplot as pit
(b) plt.plot(3,2)
(c) plt.show( )
Identify the output for the above coding

a)

b)

c)

d)

154.

Identify the right type of chart using the following hints.
Hint 1: This chart is often used to visualize a trend in data over intervals of time.
Hint 2: The line in this type of chart is often drawn chronologically.

a)

Line chart

b)

bar chart

c)

pie chart

d)

scatter plot

155.

Read the statements given below. Identify the right option from the following for pie chart.
Statement A: To make a pie chart with Matplotlib, we can use the plt.pie( ) function.
Statement B: The autopct parameter allows us to display the percentage value using the Python string formatting.

a)

Statement A is correct

b)

statement B is correct

c)

Both the statements are correct

d)

Both the statments are wrong