Font size
Worksheets12_comp_sci_onewordTest
Total questions: 155
Worksheet time: 1hrs 18mins
The small sections of code that are used to perform a particular task is called
Subroutines
Files
Pseudo code
Modules
Which of the following is a unit of code that is often defined within a greater code structure?
Subroutines
Function
Files
Modules
Which of the following is a distinct syntactic block?
Subroutines
Function
Definition
Modules
The variables in a function definition area called as
Subroutines
Function
Definition
Parameters
The values which are passed to a function definition are called
Arguments
Subroutines
Function
Definition
Which of the following are mandatory to write the type annotations in the function definition?
{ }
( )
[ ]
< >
Which of the following definies what an object can do?
Operating system
Compiler
Interface
Interpreter
Which of the following carries out the instructions defined in the interface?
Operating System
Compiler
Implementation
Interpreter
The function which will give exact result when same arguments are passed are called
Impure function
Partial function
Dynamic Functions
Pure function
The funtion which cause side effects to the arguments passed are called
Impure function
Partial function
Dynamic function
Pure function
Which of the following functions that build the abstract data type>
Constructors
Destructors
recursive
nested
Which of the following functions that retrieve information from the data type?
Constructors
Selectors
recursive
Nested
The data structure which is a mutable ordered sequence of elements is called
Built in
list
tuple
derived data
A sequence of immutable objects is called
Built in
list
Tuple
Derived data
The data type whose representation is known are called
Built in datatype
Derived Datatype
Concrete datatype
Abstract datatype
The data type whose representation is unknown are called
Built in datatype
Derived datatype
concrete datatype
Abstract datatype
Which of the following is a compound structure?
Pair
Triplet
Single
Quadrat
Bundling two values together into one can be considered as
Pair
Triplet
Single
quadrat
Which of the following allow to name the various parts of a multi item object?
Tuples
lists
Classes
Quadrats
Which of the following is constructed by placing expressions within square brackets?
Tuples
Lists
Classes
quadrats
Which of the following refers to the visibility of variables in one part of a program to another part of the same program
scope
memory
address
accessibility
The process of binding a variable name with an object is called
scope
mapping
late binding
early binding
Which of the following is used in programming languages to map the variable and object?
::
:=
=
==
containers for mapping names of variables to objects is called
scope
mapping
binding
namespaces
Which scope refers to variables defined in current function?
Local scope
Global scope
Module scope
Function scope
The process of subdividing a computer program into separate sub programs is called
Procedural programming
modular programming
Event driven programming
Object oriented programming
Which of the following security technique that regulates who cause resources in a computing environment
Password
Authentication
Access Control
Certification
Which of the following members of a class can be handled only form within the class?
Public members
Protected members
Secured members
Private members
Which members are accessible from outside the class?
Public members
Protected members
Secured members
Private members
The members that are accessible from within the class and are also available to its subclasses is called
public members
protected members
secured members
protected members
The word comes from the name of a Persian mathematician Abu Ja'far Mohammed ibn-i-Musa al Khowarizmi is called?
Flowchart
Flow
Algorithm
Syntax
From the following sorting algorithms which algorithm which algorithm needs the minimum number of swaps?
Bubble sort
Insertion sort
Selection Sort
All the above
Two main measures for the efficiency of an algorithm are ___
Processor and memory
Complexity and capacity
Time and space
Data and space
The algorithm that yields expected output for a valid input in called as __
Algorithm solution
algorithm outcomes
algorithmic problem
algorithmic coding
Which of the following is used to describe the worst case of an algorithm?
Big A
Big S
Big W
Big O
Big Ω is the reverse of
Big O
Big Θ
Big A
Big S
Binary search is also called as
Linear search
Sequencial search
Random Search
Half- Internal Search
The Θ notation in asymptotic evaluation represents
Base case
Average case
Worst case
Null case
If a problem can be broken into subproblems which are reused several times, the problem possesses which property?
Overlapping subproblems
Optimal substructure
Memization
Greedy
In dynamic programming, the technique of storing the previously calculated values is called?
Saving value property
Storing value property
Memoization
Mapping
Who developed python?
Ritche
Guido van Rossum
Bill Gates
Sunder Pitchai
The Python prompt indicates that interpreter is ready to accept instruction.
>>>
<<<
#
<<
Which of the following shortcut is used to create new python program?
Ctrl + C
Ctrl + F
Ctrl + B
Ctrl + N
Which of the following character is used to give comments in python program?
#
&
@
$
This symbol is used to print more than one item on a single line.
;
$
,
:
Which of the following is not a token?
interpreter
identifier
keyword
operators
Which of the following is not a keyword in python?
Break
While
Continue
Operators
Which operator is also called as comparitive operator?
Arithmetic
Relational
Logical
Assignment
Which of the following is not Logical operator?
and
or
not
assignment
Which operator is also called as conditional operator?
Ternary
Relational
logical
Assignment
How many important control structures are there in python?
3
4
5
6
elif can be considered to the abbreviation of
nested if
if...else
else... if
if...elif
What plays a vital role in python programming ?
statements
control
structure
indentation
Which statement is generally used as a placeholder?
continue
break
pass
goto
The condition in the if statement should be in the form of
arithmetic or relational expression
arithmetic or logical expression
relational or logical expression
arithmetic
Which of the following is known as definite loop?
do...while
While
for
if...elif
What is output of the following snippet?
i=1
while True:
if i%3 ==0:
break
print(i,end='')
i+=1
12
123
1234
124
What is the output of the following snippet?
T=1
while T:
print(True)
break
False
True
0
1
Which amongst this is not a jump statement?
for
pass
continue
break
Which punctuation should be used in the blank?
if<condition> _
statement-block 1
else:
statement block 2
;
:
::
!
A named blocks of code that are designed to do one specific job is called as
Loop
Branching
Function
Block
A function which calls itself is called as
Built-in
Recursion
Lambda
return
Which function is called anonymous un-named function
Lambda
Recursion
Function
define
Which of the following keyword is used to begin the function block?
define
for
finally
def
Which of the following keyword is used to exit a function block?
define
return
finally
def
while defining a function which of the following symbol is used
;
.
:
$
In which arguments the correct positional order is passed to a function?
required
keyword
default
variable length
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
I is correct and II is wrong
Both are correct
I is wrong and II is correct
Both are wrong
Pick the correct one to execute the given statement successfully
if ____: print(x,"is a leap year")
x%2=0
x%4==0
x/4=0
x%4=0
Which of the following keyword is used to define the function testpython():?
define
pass
def
while
Which of the following is the output of the following python code?
str1="TamilNadu"
print(str1[::-1]
Tamilnadu
Tmlau
udanlimaT
udaNlimaT
What will be the output of the following code?
str1="Chennai Schools"
str1[7]="-"
chennai-schools
chenn-School
Type error
Chennai
Which of the following operator is used for concatenation?
+
&
*
=
Defining strings within triple quotes allows creating:
single line strings
Multiline Strings
Double line Strings
Multiple strings
Strings in python:
Changeable
Mutable
Immutable
flexible
Which of the following is the slicing operator?
{ }
[ ]
< >
( )
What is stride?
index value of slide operation
first argument of slice operation
second argument of slice operation
third argument of slice operation
Which of the following formatting character is used to print expnential notation in upper case?
%f
%E
%g
%n
Which of the following is used as placeholder or replacement fields which get replaced along with format() function ?
{ }
< >
++
^^
The subscript of a string may be:
positive
negative
both a and b
either a or b
Pick odd one in connection with collection data type.
list
tuple
Dictionary
loop
Let list1=[2,4,6,8,10], then print(list1[-2]) will result in
10
8
4
6
Which of the following function is used to count the number of elements in a list?f
count( )
find( )
len( )
index( )
if List=[17,23,41,10] then List.append(32) will result
[32,17,23,41,10]
[17,23,41,10,32]
[10,17,23,32,41]
[41,32,23,17,10]
Which of the following python function can be used to add more than one element within an existing list?
appent( )
append_more( )
extend( )
more( )
if List=[10,20,30,40,50] then List[2]=35 will result
[35,10,20,30,40,50]
[10,20,30,40,50,35]
[10,20,35,40,50]
[10,35,30,40,50]
What will be teh result of the following python code
s=[x**2 for x in range(5)]
print(s)
[0,1,2,4,5]
[0,1,4,9,16]
[0,1,4,9,16,25]
[1,4,9,16,25]
What is the use of type( ) function in python?
to create a Tuple
To know the type of an element in tuple
To know the data type of python object
to create a list
Which of the following statement is not correct?
A list is mutable
A tuple is immutable
The append( ) function is used to add an element
The extend( ) function is used in tuple to add elements in a list
Let set A={3,6,9}, set B={1,3,9} what will be the result of the following snippet?
print(setA | setB)
{3,4,9,1,3,9}
{3,9}
{1}
{1,3,6,9}
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?
Symmetric difference
Difference
Intersection
Union
The keys in python, dictinary is specified by
=
;
+
:
Which of the following are the key features of an object oriented programming language?
constructor and classes
constructor and object
classes and objects
constructor and destructor
Functions defined inside a class
functions
module
methods
section
class members are accessed through which operator?
&
.
#
%
Which of the following method is automatically executed when an object is created?
__object__()
__del__()
__func_ _()
__init _ _()
Which of the following method is used as destructor?
-- init --()
__dest _ _()
__ rem _ _()
__ del _ _ ()
A private class variable is prefixed with
__
&&
##
**
Which of the following class declaration is correct?
class class_name
class class_name<>
class class_name:
class class_name[ ]
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")
Error
Tamil
name
self
Which of the following is the private class variable?
__num
##num
$$num
&&num
The process of creating an object is called as
constructor
destructor
initialize
instantiation
What is the acronym of DBMS?
DataBase Management symbol
Database Managing System
DataBase Management system
DataBasic Management system
A table is known as
tuple
attribute
relation
entity
Which database model represents parent-child relationship?
Relational
Network
Hierarchical
Object
Relational database model was first proposed by
E F codd
E E codd
E F cadd
E F codder
What type of relationship does hierarchical model represents?
one-to-one
one-to-many
many-to-one
many-to-many
Who is called Father of Relational Database from the following?
Chris Date
Hugh Darween
Edgar Frank Codd
Edgar Frank Cadd
Which of the following is an RDBMS?
Dbase
Foxpro
Microsoft Access
Microsoft Excel
What symbol is used for SELECT statement?
𝜎
π
X
Ω
A tuple is also known as __
table
row
attribute
field
Who developed ER model?
Chen
EF Codd
Chend
Chand
Which commands provide definitions for creating table structuer, deleting relations,a nd modifying relation schemas.
DDL
DML
DCL
DQL
Which command lets to change the structure of the table?
SELECT
ORDER BY
MODIFY
ALTER
The command to delete a table including the structure is
DROP
DELETE
DELETE ALL
ALTER TABLE
Queries can be generated using
SELECT
ORDER BY
MODIFY
ALTER
The clause used to sort data in a database
SORT BY
ORDER BY
GROUP BY
SELECT
A CSV file is also known as a
Flat file
3D file
String file
Random file
The expansion of CRLF is ___
Control return and line feed
Carriage return and form feed
Control Router and line feed
Carriage Return and line feed
Which of the following mode is used when dealing with non-text files like image or exe files?
Text mode
Binary mode
xls mode
csv mode
Which of the following module is provided by python to do several operations on the CSV files?
py
xls
csv
os
The command used to skip a row in a CSV file is
next( )
skip( )
omit( )
bounce( )
Which of the following is a string used to terminate lines produced by writer( ) method of csv modules?
Line Terminator
Enter key
Form Feed
Data Terminator
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
chennai,mylapore
mumbai,andheri
chennai
mumba
Chennai,mylapore
mumbai, andheri
Which of the following creates an object which maps data to a dictionary?
listreader( )
reader( )
typlereader( )
DictReader( )
Making some changes in the data of the existing file or adding more data is called
Editing
Appending
Modification
Alteration
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()
Exam Quarterly Halfyearly
Exam Quarterly Halfyearly
E
Q
H
Exam,
Quarterly
Halfyearly
Which of the following is not a scripting language?
Javascript
PHP
Perl
HTML
Importing C++ program in a python program is called
Wrapping
Downloading
Interconnecting
Parsing
The expansion of API is
Application Programming Interpreter
Application Programming Interface
Application Performing Interface
Application Programming Interlink
A framework for interfacing python and C++ is
ctypes
SWIG
Cython
Boost
Which of the following is a software design technique to split your code into separate parts?
Object oriented programming
Modular programming
Low level programming
Procedure oriented programming
The module which allows you to interface with the windows operating system is
OS module
sys module
csv module
getopt module
getopt( ) will return an empty array if there is no error in splitting strings to
argv variable
opt variable
args variable
ifile variable
identify the function call statement in the following snippet
if __name__=='__main__':
main(sys.argv[1:]
main(sys.argv[1:]
__name_ _
__main _ _
argv
Which of the following can be used for processing text, numbers, images and scientific data?
HTML
C
C++
PYTHON
What does the __ name __contains?
c++ file name
main() name
python filename
os module name
Which of the following is an organized collection of data?
Database
DBMS
Information
Records
SQLite falls under which database system?
Flat file database system
Relational database system
Hierarchical database system
object oriented Database system
Which of the following is a control structure used to traverse and fetch the records of the database?
pointer
key
cursor
insertion point
Any changes made in the values of the record should be saved by the command
save
save as
commit
oblige
Which of the following executes the SQL command to perform some action?
execute( )
key( )
cursor( )
run( )
Which of the following function retrieves the average of a selected column of rows in a table?
Add( )
SUM( )
AVG( )
AVERAGE( )
The function that returns the largest value of the selected column is
MAX( )
LARGE( )
HIGH( )
MAXIMUM( )
Which of the following is called the master table?
sqlite_master
sql_master
main_master
master_main
Which of the following keyword avoid the duplicate?
Distinct
Remove
Where
GroupBY
Which is a python package used for 2D charts?
matplotlib.pyplot
matplotlib.pip
matplotlib.numpy
matplotlib.plt
Identify the package manager for installing python packages or modules.
matplotlib
PIP
plt.show( )
python package
Which of the following feature is used to represent data and information graphically?
Data list
Data Tuple
Classes and objects
Data Visualization
__ is a collection of resources assembled to create a single unified visual display.
interface
Dashboard
Objects
Graphics
Which of the following module should be imported to visualize data and information in python?
csv
getopt
mysql
matplotlib
__ is a type of chart which displays information as a series of data points connected by straight line segments
csv
pie chart
bar chart
line chart
(a) import matplotlib.pyplot as pit
(b) plt.plot(3,2)
(c) plt.show( )
Identify the output for the above coding
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.
Line chart
bar chart
pie chart
scatter plot
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.
Statement A is correct
statement B is correct
Both the statements are correct
Both the statments are wrong
