cbse ip mcq sample question paper

CBSE Class 11, 12 IP Python Term 1 MCQ Questions Papers Sample download

CBSE Class 11, 12 IP Python Term 1 MCQ Questions Papers Sample download

Full MCQ important MCQ of IP for class 11 and 12

STUDY MATERIAL TERM-I
CLASS- XI IP


Introduction to Computer System, Evolution of Computer &
Input /Output devices


1 The Computer is an ‘electronic’ machine because
a) It works using electricity
b) It works without moving parts
c) It has a CPU
d) It has moving parts

2 What is the difference between data and information?
a) Computers process information not data
b) Information is the representation of data on a computer
c) Data is the representation of information
d) Both are the same

3 Which of these are advantages of using a computer?
a) Speed, dependency and cost effectiveness
b) Resentment and accuracy
c) Data input and output
d) Speed, consistency and reliability

4 Which of the following are disadvantages of computerizing a system?
a) Resentment towards the system from staff members and possibility of
hacking
b) Accuracy and health risks
c) Dependency on the system and storage of large volumes of data
d) Consistency

5 At which of these jobs is a computer better suited than humans?
a) Going through a large database to find a particular name
b) Deciding on which dress best suits a model
c) Appreciating a painting
d) Choosing the most nice-smelling perfume

6 Which of the following are hardware items?
a) Motherboard
b) CPU

Page 2 of 42
c) RAM
d) All the above
7 The computer’s main circuit board is called a ________.
1. Hard Disk
2. Motherboard
3. CPU
4. Blue Tooth

8 Which of the following is a type of Main Memory?
a) Bus
b) Hard Disk
c) CPU
d) RAM

9 Which components of a computer connects the processor to the other hardware?
a) System Bus
b) CPU
c) Memory
d) Input

10 Which of the following is referred to as the brain of computer?
a) CPU
b) RAM
c) ROM
d)Hard Drive

11 The Physical component of computer are called:
a) Software
b) Hardware
c) ALU
d) CPU

12 Which smaller unit of CPU directs and coordinates all activities within it and
determines the sequence in which instructions are executed , sending instructions
sequence to other smaller unit
a) CU
b) ALU
c) Processor
d) All of these

13 Which smaller unit of the CPU performs all arithmetic and logic functions in
computer?
a) CU
b) ALU
c) Processor
d) All of these

14 Component of CPU which is responsible for comparing the contents of two pieces
of data is
a) ALU
b) CU
c) Memory
d) Register

Page 3 of 42
15 In a computer, CU stands for
a) Control Unit
b) Cache Unit
c) Calculating Unit
d) Communication Unit

16 Arithmetic and logic unit along with control unit of a computer, combined into a
single unit, is known as
a) Central Processing Unit
b) Memory Unit
c) I/O unit
d) Operating Unit

17 Two basic functions of a computer system are:
a) Word processing and Spreadsheet
b) Sending email and web browsing
c) Sending and receiving information
d) Mouse and keyboard

18 Any data and instruction entered in the memory of a computer is
A) Storage
B) Output
C) Input
D) Information

19 Which of the following is not an input device?
A) Keyboard
B) Monitor
C) Joystick
D) Microphone

20 What is a function of a keyboard in computer?
A) Print
B) Input
C) Type
D) In between input and output

21 The general method for to input the text and numerical data in computer is by
________?
A) Keyboard
B) Scanner
C) Printer
D) Platter

22 What type of device is a computer printer?
A) Input
B) Output
C) Software
D) Storage

23 Which keys enable the input of numbers quickly?
A) Function keys
B) The numeric keypad
C) Shift and alt

Page 4 of 42
D) Arrow keys
24 Which of the following could be digital input devices for computers?
A) Digital camcorder
B) Microphone
C) Scanner
D) All of the above

25 Which of these is a point and draw device?
A) Mouse
B) Scanner
C) Printer
D) CD-ROM

26 A term in computer terminology is a change in technology a computer is/was
being used.
a) development
b) generation
c) advancement
d) growth

27 The generation based on VLSI microprocessor.
a) 1st
b) 2nd
c) 3rd
d) 4th

28 The period of ________ generation was 1956-1964.
a) 1st
b) 2nd
c) 5th
d) 4th

29 What was the name of first computer designed by Charles Babbage?
a) Analytical Engine
b) Difference Engine
c) Colossus
d) ENIAC

30 Which was the first electronics digital programmable computing device?
a) Analytical Engine
b) Difference Engine
c) Colossus
d) ENIAC

31 HLL stands for?
a) High Level Language
b) High Layman’s Language
c) High Level Lesson
d) High Layman’s Lesson

32 IBM Series computers belongs to :
a) First Generation Computers
b) Second Generation Computers
c) Third Generation Computers
d) Fourth Generation Computers

33 In 5th Generation of computers , ___________ came into existence:
a) Micro Processors
b) Vacuum Tubes
c) Pentium
d) Robotics Devices

34 ___________ is an emerging branch in computer science, which interprets means
and method of making computers think like human beings.
a) Block chain
b) VR
c) AI
d) Cloud computing

35 ENIAC stands for __________.
a) Electronic Numerical Integrator And Computer
b) Electronic Numerical Integrator And Calculator
c) Electronic Numerical Integrator Automatic Computer
d) Electronic Numerical Integrator Automatic Calculator

36 Tom has been researching into the use of games consoles and special input devices
to increase children’s participation :
Identify two specialist input devices that would involve players directly in
exercise
whilst using games consoles
a) Light Pen
b) Keyboard
c) Joystick
d) Mouse

37 The Fun Gym website has a ‘news’ section that includes photographs and articles
about the instructions and special events.
Identify one input device that can be used to capture photographs to use on the
websites :
1.Scanner
2. Web Cam
3. OCR
4. All of above

38 NVS dpg. 6ecided to computerize all their manual work , for the security purpose
t They want to install a system which can record person’s true identity in records
for future references. Suggest them some device which can help them to do so:
a) Scanner
b) Biometric Device
c) Light pen
d) Touch Screen

39What is the device shown in the picture?
a. Webcam
b. Microphone
c. Speaker
d. OMR

40 Consider the following statements:
1. One of the earliest known computation devices is Abacus.
2. French scientist Blaise Pascal had invented the first mechanical calculator.
Choose the correct answer from the codes given below:
A – Only 1
B – Only 2
C – Both
D – Neither 1 nor 2

COMPUTER MEMORY AND SOFTWARE
1 What is the full form of SSD in context of computer memory?
a. Single sided device
b. Solid State Drive
c. Solid Single Disk
d. State Solid Drive

2 Storage of 1 KB means the ____________ number of bytes
a. 2056
b. 1000
c. 1024
d. 2000


3 What is smallest unit of the information?
a. A bit
b. A block
c. A Byte
d. A nibble

4 Storage which stores or retains data after power off is called
a. Volatile storage
b. Non-volatile storage
c. Sequential storage
d. Direct storage

5 A permanent memory, which halls (holds) data and instruction for start-up the
computer and does not erase data after power off.
a. Network interface card
b. CPU
c. RAM
d. ROM

6 Which device is used to back up the data?
a. Floppy Disk
b. Magnetic Tape
c. Network Drive.
d. All of the above

7 A half byte is known as_____.
a. Data
b. Bit
c. half byte
d. nibble

 

 

 

Page 8 of 42
8 Main memory of computer is –
a. Internal
b. External
c. (a) and (b) both
d. Auxiliary

9 What is the permanent memory built into your computer called?
a. RAM
b. ROM
c. CPU
d. CD-ROM

10 RAM is a…….memory
a. External
b. Auxiliary
c. Main
d. none of these

11 Hard disc drives are considered………storage-
a. Flash
b. Non-volatile / Permanent
c. Temporary
d. Non-permanent

12 Flash memory is also called as __________.
a. Flash RAM
b. Flash ROM
c. Flash DROM
d. None of these

13 State True or False.
“A flash memory works in a similar way to RAM. The key difference is that data
is retained in Flash memory even when the power is switched off.’
a. True
b. False

14. Time taken to retrieve data from a storage device is known as.
a. Arrival time
b. Access time
c. Refresh time
d. Reach time

15 Which of the following medium is used between CPU & RAM TO speed up the
processing power of a CPU?
a. Virtual Memory
b. D RAM
c. Flash Memory
d. Cache Memory

16 When data is found in cache, it is called a __________
a. Cache win
b. Cache hit
c. Cache miss
d. None of above

17 The physical and tangible components of the computer are known as
a. Hardware
b. Software
c. Both of the above
d. None of the above

18 Which of the following software is available without any payment?
a. Freeware
b. Free software
c. OSS
d. FLOSS

19 Which of the following is the common measurement of unit of computer memory?
a. IQ
b. Byte
c. Terabyte
d. Gigabyte


20 Which of the following makes available its source code?
a. Freeware
b. Free software
c. OSS
d. Proprietary software

21 Operating System is an example of
a. Application Software
b. System Software
c. Utility Software
d. None of these

22 Word processor and Desktop Publish program are the examples of
a. Hardware
b. Software
c. CPU
d. None of these

23 What is the name of programs that control the computer system?
a. Hardware
b. Keyboard
c. Software
d. Mouse

24 The set of programs necessary to carry out operations/tasks pertaining to a specific
application, are called _______________
a. Application Software
b. System Software
c. Utility Software
d. None of these

25 State True or False.
“Language processors are a type of Application Software.”
a. True
b. False


26. _______________ is a tailor made software according to user’s requirement.
a. Application Software
b. System Software
c. Utility Software
d. Customized Software

27 State True or False.
“An operating system is a program which acts as an interface between the user and
the hardware”
a. True
b. False

28 Which of the following software can’t be categorized application
software?
a. DBM
b. MS-DOS
c. Spreadsheet
d. Word processing

29 Examples of system programs includes
a. operating system of computer
b. compiler
c. all of above
d. none of above

30 The _________ memory is a special high speed memory storing the most recently
accessed data.
a. Cache
b. ROM
c. Flash
d. None of above

31 Full form of FLOSS is
a. Free and open source software
b. Free libre and Open Source Software
c. Free liberal open ended system software
d. Free liberty of open software source

 

 

32 _______________ is a software that is neither open nor freely available.
a. OSS
b. Freeware
c. Proprietary software
d. Application software

33 ____________ is a system software that translates and executes instructions
written in a computer program line-by-line.
a. Assembler
b. Interpreter
c. Compiler
d. None of these

34 ______________ are the programs that store instructions to drive and use different
hardware devices.
a. Device drivers
b. Applications
c. Language processors
d. None of the above

35 _______________ are the software, which permit redistribution but not
modification as their source code is not available.
a. Freeware
b. Free software
c. System software
d. None of above

36 A disk fragmentor is an example of
a. Application software
b. System software
c. Utility software
d. None of the above

Page 13 of 42
37 State True or False
“Software is a set of instructions and data that makes hardware functional to
complete the desired task.”
a. True
b. False

38 State True or False
“Hardware of a computer can function on its own. It needs no software to be
operational or functional”
a. True
b. False

39 Which of the following is not an operating system?
a. Windows
b. Linux
c. Oracle
d. DOS

40 Which of the following is not application software?
a. Windows 7
b. WordPad
c. Photoshop
d. MS-excel


Python Programming Fundamentals
Q 1 Single Line comments in Python begin with …… symbol.
a) # b) % c) ; d) “
1
Q 2 The extension of Python file is given as –
a) .ppt b ) .py c) .pdoc d).ppp
1
Q 3 Which of the following operator is floor division ?
a) <b) // c) / d) +
1
Q 4 Which of the following is an invalid statement ?
a) I=J=K=50 b) I,J,K=50,60,70 c) I J K =50 60 70 d) I_J_K=70
1

Page 14 of 42
Q 5 Which of the following functions print the output to the console ?
a) Output( ) b) Print ( ) c) Echo( ) d) print ( )

Q 6 Select the reserved words in Python .
a) if b) input c) import d) all of these

Q 7 What will be the output of the following code ?
x,y=2,6
x,y=y,x+2
print(x,y)
a) 6 6 b ) 4 4 c ) 4 6 d ) 6 4

Q 8 Choose the perfect word for Python , Python is a …. Language
a) Upper case b ) Upper Lower case c) Case sensitive d ) None


Q 9 The reserved words used by Python interpreter to recognize the structure of a
program are termed as
a) Keywords b ) Identifiers c) Token d) Literals

Q 10 Operators that act upon two operands are referred as …..
a) Unary operator b) Binary operator c) Assignment operator d) None

Q 11 The Error that occurs during the execution of the program is known as ….
a) Syntax Error b ) Semantics Error c ) Run time error d) None

Q 12 The conversion of one data type to another data type is known as ….
a) Debugging b) Function c)Type casting d ) All of these

Q 13 What will be the output of the following expression
12 * ( 13%4 ) // 2 + 6
a) 55 b) 24 c ) 22 d) 21

Q 14 Choose the example of Mutable Objects
a) int b) complex c) bool d) list

Q 15 Shivi has written the following program but she is not getting the desired result
.Why ?
a=input(“enter a number”)
b=input(“enter 2nd Number”)
c=a+b
print(c)
a) wrong coding b) type casting problem c) formula of sum is incorrect d)

Page 15 of 42
none
Q 16 Choose the correct identifier name
a) 9marks b)&sum c ) _Total d) All are correct

Q 17 The given program has an error , find out the correct option with line number.
10=a #Line 1
b=45 #Line 2
a+b=c #Line 3
print( c ) #Line 4
Error in line number …
a) 1 b) 2 c) 3 d) 1 & 3

Q 18 p=20
print(id(p))
These statements will give
a) Address of p b ) value of p c) address & value both c) none

Q 19 The Escape sequence \n is used for …
a) New line b) new word c) new Character d ) All of these

Q 20 type ( ) function is used to find out the ….
a) To declare a function
b) To define a function
c) To know the type of variable
d) None

Q 21 > is the example of ……. Operator
a) Arithmetic b) relation c) logical d) assignment

Q 22 What will be the output of the following code
print( ‘H’ in ‘Hello’)
a) Hello b ) ello c ) true d ) None

Q 23 Slicing is used to retrieve a …… of values .
a) Subset b) 2 values c) big All of these

Q 24 In Python automatic data conversion is known as …. Type conversion
a) Explicit b ) implicit c) mix d) None

Q 25 In Python a function is defined by ……….keyword.
a) Definition b) Def c) user d ) def

Page 16 of 42
Q 26 An identifier must be a keyword of Python
a) True b ) False

Q 27 What will be the output of the following code
p=10
q=20
p*=q/3
q+=p+q*2
print(p,q)
a) 66.666 126.66
b) 78.66 162.66
c) 126.66 66.66
d) 89.22 156.99

Q 28 Rohan is making program in python when he is taking whole number , result of
program is correct but when he is taking decimal values , he is not getting result
according to decimal values . He is getting result on basis of whole numbers ,
what he should do to get the accuracy in result .
a) Re – write the program
b) Give comment in program
c) Change int data type in to float
d) Refresh the program

Q 29 In python a variable can hold values of different types at different times. It is
known as …….
a) Multi tasking
b) Multi capacity
c) Dynamic typing
d) Attribute of comment

Q 30 To remove the errors from the program is …..
a) Bug b) debug c) semantics d) None

Q 31 Shalini is writing the following code ,
p
q
print(p,q)

Page 17 of 42
She is getting an error why?
a) Values are not assigned to p & q
b) P & q are written in separate lines
c) P & q are not made comments
d) None


Q 32 1. What is the maximum possible length of an identifier?
a) 31 characters
b) 63 characters
c) 79 characters
d) none of the mentioned
1
Q 33 Who developed the Python language?
a) Zim Den
b)Wick van Rossum
c) Guido van Rossum
d) NieneStom
1
Q 34 What do we use to define a block of code in Python language?
a) Key
b) Brackets
c) Indentation
d) None of these
1
Q 35 How many keywords present in the python programming language?
a) 32
b) 61
c) 33
d) 27
1
Q 36 In which language is Python written?
a. English
b. PHP
c. C
d. All of the above
1
Q 37 Which of the following operators is the correct option for power(ab)?
a. a ^ b

Page 18 of 42
b. a**b
c. a ^ ^ b
d. a ^ * b


Q 38 Which of the following precedence order is correct in Python?
a. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
b. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
c. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
d. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

Q 39 What is the answer to this expression, 22 % 3 is?
a) 7
b) 1
c) 0
d) 5

Q 40 What error occurs when you execute the following Python code snippet?
apple = mango
a)SyntaxError
b)NameError
c)ValueError
d) TypeError

Control Statement: if..else… and for loop
1 Which of the following is a selection control statement:-
a. for b. while c. if..else.. d. print

2 Which of the following is a loop control statement:-
a. for b. do..while c. if..else.. d. print

3 Which of the following is not a valid statement is Python:-
a. for b. while c. if..else.. d. do..while..

4 In statement: for var in ___________ : , the blank can be filled with
(choose two options)
a. Single Value b. An iterable sequence c. an expression. d. range()

5 In statement: for var in range(3) : , the range(3) is equivalent to: 1

Page 19 of 42
(choose two options)
a. range(1,3) b. range(0,3) c. range(1,3,0) d. range(0,3,1)
6 In statement: for var in range(4) : , the range(4) will yield an iterable
sequence like :
a. [0,2,4] b. [1,2,3,4] c. [0,1,2,3] d. [0,1,2,3,4]

7 Which of the following statements will not executes successfully?
a. if (1,2): b. if (1,2)
print(“foo”) print(“foo”)
c. if (2): d. if (1) :
print(“foo”) print(“foo”)

8 In an if..else… statement the _____________ portion is optional.
a. colon (:) b. Expression c. else d. if

9 In a for statement the _____________ portion is optional.
a. colon (:) b. Expression c. else d. for

10 How many times following loop will execute:
for x in range(-5):
print(x)
a. 5 b. 0 c. infinite d. Error

11 How many times following loop will execute:
for x in range(3):
pass
a. 3 b. 0 c. infinite d. 2

12 How many times following loop will execute:
for x in “Computer”:
print(x)
a. 10 b. 1 c. 8 d. 0

13 How many times following loop will execute:
for x in [1,3,5,7,9,11]:
print(x)
a. 3 b. 5 c. 7 d. 6

Consider the following code segment for the questions 14 to 19
a=int(input(“Enter an integer”)
b=int(input(“Enter an integer”)

Page 20 of 42
if a<=0:
b=b+1
else:
a=a+1
if a>0 and b>0:
print(“W”)
elif a>0:
print(“X”)
if b>0:
print(“Y”)
else:
print(“Z”)
14 What letters will be printed if the user enters 0 for a and 0 for b?
a. Only W b. Only X c. only Y d. W and Y e. W,X and Y

15 What letters will be printed if the user enters 1 for a and 1 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y

16 What letters will be printed if the user enters 1 for a and -1 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y

17 What letters will be printed if the user enters 1 for a and 0 for b?
a. W and X b. W and Y c. X and Y d. X and Z e. W,X and Y

18 What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W b. Only X c. only Y d. W and Y e. only Z

19 What letters will be printed if the user enters 2 for a and 2 for b?
a. Only W b. Only X c. only Y d. W and Y e. W,X and Y

Consider the following code and answer the questions 20 to 23
x=int(input(“Enter an integer”))
if x <= 0 :
print(“North”)
elf if x >2 :
print(“South”)
if x = = 5 :
print(“West”)

Page 21 of 42
else :
print(“East”)
20 What will be printed if the user enters 2 for a
a. North b. South c. West d. East e. South West

21 What will be printed if the user enters -2 for a
a. North b. South c. West d. East e. South West

22 What will be printed if the user enters 5 for a
a. North b. South c. West d. East e. South West

23 What will be printed if the user enters 4 for a
a. North b. South c. West d. East e. South West

24 “Else portion of for loop statement is optional and executes after completion of
for loop.”
a. True b. False

25 Which will be the correct if statement for expression : “Place is either Delhi or
Goa but not Jaipur”
a. if place= = “Delhi” and place= = “Goa” and place != “Jaipur” :
b. if place= = “Delhi” or place= = “Goa” and place != “Jaipur” :
c. if place= = “Delhi” and place= = “Goa” or place != “Jaipur” :
d. if (place= = “Delhi” or place= = “Goa” ) and place != “Jaipur” :

26 What will be the output of following code:
for x in range(3):
pass
else:
print(x)
a. 4 b. 3 c. 1 d. 2

Consider the following code and answer the Question 27 to 29
X=int(input(“Enter integer”))
Y=int(input(“Enter integer”))
Z=int(input(“Enter integer”))
for K in range (X, Y, Z):
print(K, end= “ ,”)
27 What will be printed if the user enters 2 for X , 10 for Y and 2 for Z
a. 2, 4, 6, 8,10 b. 10,8,6,4

Page 22 of 42
c. 2, 4, 6, 8 d. 10, 8, 6, 4, 2
28 What will be printed if the user enters 10 for X , 2 for Y and -2 for Z
a. 2, 4, 6, 8,10 b. 10,8,6,4
c. 2, 4, 6, 8 d. 10, 8, 6, 4, 2

29 What will be printed if the user enters 10 for X , 2 for Y and 4 for Z
a. 2, 4, 6, 8,10 b. Nothing will come on screen
c. Infinite loop d. 10, 8, 6, 4, 2

30 How many times “Hello” will print on screen after execution of given code:
for x in range(3):
for y in range(x):
print(“Hello”)
a. 2 times b. 4 times
c. 3 times d. 6 times

31 How many times “Entry” will print on screen after execution of given code:
for x in range(3,9,3):
print(“Entry”)
for y in range(x,0,-2):
print(“Hello”)
else:
print(“Entry”)
a. 2 times b. 4 times
c. 3 times d. 6 times

32 Which for loop statement will produce first 10 odd numbers: (choose two
options)
a. for x in range(1,19,2):
b. for x in range(1,20,2):
c. for x in range(19, 1, -2):
d. for x in range(19,-1,-2):
33 Which statement contains error in following Python Code: ( Choose two
options)
for x in range(3,9,3)
print(“Hello”)
ELSE:

Page 23 of 42
print(“Entry”)
a. for x in range(3,9,3) b. print(“Entry”)
c. ELSE: d. print(“Hello”)
34 Which statement contains error in following Python Code: ( Choose two
options)
for x (3,9,3):
print(“Hello”)
else:
print(Entry)
a. for x (3,9,3): b. print(Entry)
c. else: d. print(“Hello”)

35 Which statement contains error in following Python Code: ( Choose four
options)
for x “Computer”:
print(“Entry”)
for y in range(x:0:-2):
print “Hello”
else:
print(“Good Bye’)
a. for x “Computer”: b. print(“Entry”)
c. for y in range(x:0:-2): d. print “Hello”
e. else: f. print(“Good Bye’)

36 Which statement contains error in following Python Code: ( Choose two
options)
x,y=10,20
if x > y
print(“Greater no” , x)
else:
print(“Greater no” ; y)
a. if x > y b. print(“Greater no” , x)
c. else: d. print(“Greater no” ; y)

What will print on screen after execution of given code:
text=’Exam2021′
result=””
for x in range(len(text)-1,-1,-1):
result+=text[x]
else:
print(‘Result=’,result)
print(‘Good Bye=’,x)
a. Result=1202maxE, Good Bye=0 b. Result=MAXe1202, Good Bye=1
c. Result=MAXe1202, Good Bye=1 d. Result=maxE1202, Good Bye=0

List Operations, List Methods and Built-in Functions
1. Suppose list1 is [2, 33, 222, 14, 25], What is list[-1]?
a. Error b. None
c. 25 d. 2

2. Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
a. [2, 33, 222, 14] b. Error
c. 25 d. [25, 14, 222, 33, 2]

3. Suppose list1 is [1,3,2], What is list1 * 2?
a. [2,6,4] b. [1,3,2,1,3]
c. [1,3,2,1,3,2] d. [1,3,2,3,2,1]

4. If list1=[11,2,23] and list2=[11,2,2], What will be the output of
print(list1<list2)?
a. True b. False
c. Error d. None

5. To add a new element to a list, we use which command?
a. list1.add(5) b. list1.append(5)
c. list1.addLast(5) d. list1.addEnd(5)

Page 26 of 42
6. To remove string “hello” from list1, we use which command?
a. list1.remove(“hello”) b. list1.remove(hello)
c. list1.removeAll(“hello”) d. list1.removeOne(“hello”)

7. Suppose list1 is [3,4,5,20,5], What is list1.index(5)?
a. 0 b. 1
c. 4 d. 2

8. What will be the output of the following code?
list1=[1,3]
list2=list1
list1[0]=4
print(list2)
a. [1,3] b. [4,3]
c. [1,4] d. [1,3,4]

9. What will be the output of the following code?
list1=[8,0,9,5]
print(list1[::-1])
a. [5,9,0,8] b. [8,0,9]
c. [8,0,9,5] d. [0,9,5]

10. Which of the following will give output as [23,2,9,75] if
list1=[6,23,3,2,0,9,8,75]?
a. print(list1[1:7:2]) b. print(list1[0:7:2])
c. print(list1[1:8:2]) d. print(list1[0:8:2])

11. What will be the output of the following python code?
list1=[“Python”, “Java”, “c”, “C”, “C++”]
print(min(list1))
a. c b. C++
c. C d. min function cannot be used for string

12. What will be the result after execution of above python code?
list1=[3,2,5,7,3,6]
list1.pop(3)
print(list1)
a. [3,2,5,3,6] b. [2,5,7,3,6]
c. [2,5,7,6] d. [3,2,5,7,3,6]

13. Write the output of the following code: list(“welcome”)
a. [‘w’,’e’,’l’,’c’,’o’,’m’,’e’] b. (‘w’,’e’,’l’,’c’,’o’,’m’,’e’)

Page 27 of 42
c. [‘welcome’] d. None of the above
14. Write the output of the following code:
L=[0.5*x for x in range(4)]
print(L)
a. [0.0,0.5,1.0,1.5] b. (0.5,1.5)
c. [0.0,0.5,1.0,1.5,2.0] d. Error

15. Write the output of the following code:
L=[1,2,3,4,5]
for i in L:
print(i,end=“ ”)
a. 1 2 3 4 5 b. 1 3 5
c. Error d. None of the above

16. Write the output of the following:
T=[1,2,3,4]
T1=[3,4,5,6]
T2=T.append(T1)
print(T2)
a. [1,2,3,4,[3,4,5,6]] b. [1,2,3,4,3,4,5,6]
c. None d. None of the above

17. What is the output of the following?
L=[[‘Physics’,101],[‘Chemistry’,202],[‘Maths’,303],45,6,’j’]
print(len(L))
a. 3 b. 4
c. 5 d. 6

18. What is the output of the following code:
list1=[3,2,5,7,3,6]
list1.insert(6,3)
print(list1)
a. [3,2,5,6,7,3,6] b. [3,2,5,6,3,6]
c. [3,2,5,7,3,6,3] d. None of these

19. Which of the following command will create a list?
a. list1=list() b. list1=[ ]
c. list1=list([1,2,3]) d. All of these

20. What is the output when the following code is executed?
names=[‘Amir’,’Bear’,’Charlton’,’Daman’]
print(names[-1][-1])

Page 28 of 42
a. A b. Daman
c. Error d. n
21. What is the output of the following code?
‘welcome to python’.split()
a. [‘welcome’,’to’,’python’] b. (‘welcome’,’to’,’python’)
c. {‘welcome’,’to’,’python’} d. ‘welcome’,’to’,’python’

22. What will the output of the following code?
list1=[1,2,3,4]
list2=[5,6,7,8]
print(len(list1+list2))
a. 2 b. 4
c. 5 d. 8

23. Select the output of the following expression:
str1=’pen’
print(list(str1))
a. [‘p’,’e’,’n’] b. [pen]
c. [p/e/n] d. {‘pen’}

24. What is the correct way to get minimum value from a list in python?
a. print(minimum(mylist)) b. print(min(mylist))
c. print(mylist.min()) d. print(mylist.minimum())

25. Suppose list1 is [3,4,5,20,5,25,1,3], What is list1.count(5)?
a. 0 b. 4
c. 1 d. 2


26. What will be the output of the following code?
myList=[1,2,3,4,5,6]
for i in range(1,6):
myList[i-1]=myList[i]
for i in range(0,6):
print(myList[i],end=’ ‘)
a. 2 3 4 5 6 1 b. 6 1 2 3 4 5
c. 2 3 4 5 6 6 d. 1 1 2 3 4 5

27. What will be the output of the following python code?
names1=[‘Amir’,’Bala’,’Charles’]

Page 29 of 42
if ‘amir’ in names1:
print(1)
else:
print(2)
a. None b. 1
c. 2 d. Error
28. What will be the output of the following python code?
names1=[‘Amir’,’Bala’,’Charlie’]
names2=[name.lower() for name in names1]
print(names2[2][0])
a. None b. a
c. b d. c

29. What will be the output of the following python code?
matrix=[[1,2,3,4],
[4,5,6,7],
[8,9,10,11],
[12,13,14,15]]
for i in range(0,4):
print(matrix[i][1],end=’ ‘)
a. 1 2 3 4 b. 4 5 6 7
c. 1 3 8 12 d. 2 5 9 13

30. What will be the output of the following code?
a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)
a. [13,56,17,[87],45,67 b. [13,56,17,87,45,67]
c. [13,56,17,87,[45,67]] d. [13,56,17,[87],[45,67]]

31. Which command is used to insert 6 in a list “L” at 3rd position?
a. L.insert(2,6) b. L.insert(3,6)
c. L.add(3,6) d. L.append(2,6)

32. Which of the following data type is shown below?
L=[2,54,’javatpoint’,5]
a. Dictionary b. Tuple
c. List d. Stack

33. Find the output of the following code:
list=[1,2,3,None,(1,2,3,4,5),[‘Geeks’,’for’,’Geeks’]]

Page 30 of 42
print(len(list))
a. 12 b. 11
c. 6 d. 22
34. What will be the output of the following code?
L=list(“www.csiplearninghub.com”)
print(L[20 : -1])
a. [‘c’ , ‘o’] b. [‘c’ , ‘o’ , ‘m’]
c. (com) d. Error

35. Find the output of the following statements:
list1=range(100,110)
print(list1.index(105))
a. 105 b. 5
c. 106 d. 104

36. Find the output of the following program:
L1=[1,2,3,4]
L2=L1
L3=L1.copy()
L4=L1
L1[0]=[5]
print(L1,L2,L3,L4)
a. [5,2,3,4] [5,2,3,4] [1,2,3,4] [1,2,3,4]
b. [[5],2,3,4] [[5],2,3,4] [[5],2,3,4] [1,2,3,4]
c. [5,2,3,4] [5,2,3,4] [5,2,3,4] [1,2,3,4]
d. [[5],2,3,4] [[5],2,3,4] [1,2,3,4] [[5],2,3,4]

37. Find the output of the following code:
L=[1,3,5,7,3]
print(L.pop(-3),end=’ ‘)
a. 5 b. 9
c. 7 d. 3

38. What will be the output of the following code snippet?
fruit_list1=[‘Apple’,’Berry’,’Cherry’,’Papaya’]
fruit_list2=fruit_list1
fruit_list3=fruit_list1[:]
fruit_list2[0]=’Guava’
fruit_list3[1]=’Kiwi’
sum=0

Page 31 of 42
for ls in(fruit_list1,fruit_list2,fruit_list3):
if ls[0]==’Guava’:
sum+=1
if ls[1]==’Kiwi’:
sum+=20
print(sum)
a. 22 b. 21
c. 0 d. 43
39. If you try to access the item outside the list index, then what type of error it may
give?
a. List is not defined b. List index out of range
c. List index out of bounds d. No error

40. What is the output of the following code?
list=[‘a’,’b’,’c’]
list+=’de’
print(list)
a. [‘a’,’b’,’c’,’d’,’e’] b. [‘a’,’b’,’c’,’de’]
c. c. [‘ade’,’bde’,’cde’] d. This raises an exception that we cannot
add
string to a list

Dictionary ,Dictionary methods and Built in Methods
Q.No Question Marks
1 To create a new dictionary with no items :
(a) Dict
(b) dict( )
(c) d1={ }
(d) both (ii) and (iii)

2 Which of the following function will return key – value pairs of the
dictionary in the form of list of tuples ?
(a) key ( )
(b) values ( )
(c) items ( )
(d) get ( )

3 Keys of a dictionary must be:
(a) similar
(b) unique
(c) can be similar or unique
(d) all of these

Page 32 of 42
4 Which function is used to remove all items form a particular dictionary ?
(a) clear ( )
(b) pop ( )
(c) delete ( )
(d) rem ( )

5 In a dictionary ,the elements are accessed through
(a) key
(b) value
(c) index
(d) none of these

6 Which of the following is correct with respect to above Python code?
d={“a”:3,”b”:7}
(a) a dictionary d is created.
(b) a and b are the keys of dictionary d.
(c) 3 and 7 are the values of dictionary d
(d) All of the above.

7 Which one of the following is correct?
(a) In python, a dictionary can have two same keys with different values.
(b) In python, a dictionary can have two same values with different keys
(c) In python, a dictionary can have two same keys or same values but
cannot have two same key-value pair
(d) In python, a dictionary can neither have two same keys nor two same
values.

8 What will be the output of above Python code?
d1={“abc”:5,”def”:6,”ghi”:7}
print(d1[0])
(a) abc
(b) 5
(c) {“abc”:5}
(d) Error

9 What will the above Python code do?
dict={“Phy”:94,”Che”:70,”Bio”:82,”Eng”:95}
dict.update({“Che”:72,”Bio”:80})
(a) It will create new dictionary as dict={“Che”:72,”Bio”:80} and
old dict will be deleted.
(b) It will throw an error as dictionary cannot be updated.
(c) It will simply update the dictionary as

Page 33 of 42
dict={“Phy”:94,”Che”:72,”Bio”:80,”Eng”:95}
(d) It will not throw any error but it will not do any changes in dict
10 What will be the result of above Python code?
dict={“Joey”:1,”Rachel”:2}
dict.update({“Phoebe”:2})
print(dict)
(a) {“Joey”:1,”Rachel”:2,”Phoebe”:2}
(b) {“Joey”:1,”Rachel”:2}
(c) {“Joey”:1,”Phoebe”:2}
(d) Error

11 Which of the following is False regarding dictionary in Python?
dict={“Joey”:1,”Rachel”:2}
dict.update({“Phoebe”:2})
print(dict)
(a) Values of a dictionary can be string,integers or combination of both.
(b) Keys of a dictionary can be string,integers or combination of both
(c) The value of a dictionary can be accessed with the help of indices.
(d) None of the above

12 Which of the following will delete key_value pair for key=”tiger” in
dictionary?
dic={“lion”:”wild”,”tiger”:”wild”,”cat”:”domestic”,”dog”:”domestic”}
(a) del dic[“tiger”]
(b) dic[“tiger”].delete()
(c) delete(dic.[“tiger”])
(d) del(dic.[“tiger”])

13 Which of the following will give error?
Suppose dict1={“a”:1,”b”:2,”c”:3}
(a) print(len(dict1))
(b) print(dict1.get(“b”))
(c) dict1[“a”]=5
(d) None of these.

14 Which of the following Python codes will give same output if 1

Page 34 of 42
(a) dict.pop(“book”)
(b) del dict[“book”]
(c )dict.update({“diary”:1,”novel”:5})
(i) a,b,c
(ii) a,b
(iii) a,c
(iv) b,c
15 What will be the following Python code?
dict1={“a”:10,”b”:2,”c”:3}
str1=””
for i in dict1:
str1=str1+str(dict1[i])+” ”
str2=str1[:-1]
print(str2[::-1])
(a) 3,2
(b) 3,2,10
(c) 3,2,01
(d) Error

16 Which of the following isn’t true about dictionary keys?
(a) More than one key isn’t allowed
(b) Keys must be immutable
(c) Keys must be integers
(d) When duplicate keys encountered, the last assignment wins

17 What will be the output of the following Python code?
a={1:5,2:3,3:4}
print(a.pop(4,9))
(a) 9
(b) 3
(c) Too many arguments for pop() method
(d) 4

18 What will be the output of the following Python code? 1

Page 35 of 42
a={1:”A”,2:”B”,3:”C”}
for i in a:
print(i,end=” “)
(a) 1 2 3
(b) ‘A’ ‘B’ ‘C’
(c) 1 ‘A’ 2 ‘B’ 3 ‘C’
(d) Error, it should be: for i in a.items():
19 What will be the output of the following Python code?
>>> a={1:”A”,2:”B”,3:”C”}
>>>a.items( )
(a) Syntax error
(b) dict_items([(‘A’), (‘B’), (‘C’)])
(c) dict_items([(1,2,3)])
(d) dict_items([(1, ‘A’), (2, ‘B’), (3, ‘C’)])
1
20 Which of the statements about dictionary values if false?
(a) More than one key can have the same value
(b) The values of the dictionary can be accessed as dict[key]
(c) Values of a dictionary must be unique
(d) Values of a dictionary can be a mixture of letters and numbers
1
21 What will be the output of the following Python code snippet?
>>> a={1:”A”,2:”B”,3:”C”}
>>> del a
(a) method del doesn’t exist for the dictionary
(b) del deletes the values in the dictionary
(c) del deletes the entire dictionary
(d) del deletes the keys in the dictionary
1
22 If a is a dictionary with some key-value pairs, what does a.popitem( ) do?
(a) Removes an arbitrary element
(b) Removes all the key-value pairs
(c) Removes the key-value pair for the key given as an argument
(d) Invalid method for dictionary
1
23 What will be the output of the following Python code snippet? 1

Page 36 of 42
total={}
def insert(items):
if items in total:
total[items] += 1
else:
total[items] = 1
insert(‘Apple’)
insert(‘Ball’)
insert(‘Apple’)
print (len(total))
(i) 3
(ii) 1
(iii) 2
(iv) 0
24 Which of the following statements create a dictionary?
(a) d = {}
(b) d = {“john”:40, “peter”:45}
(c) d = {40:”john”, 45:”peter”}
(d) All of the mentioned
1
25 What will be the output of the following Python code snippet?
d = {“john”:40, “peter”:45}
(a) “john”, 40, 45, and “peter”
(b) “john” and “peter”
(c) 40 and 45
(d) d = (40:”john”, 45:”peter”)
1
26 What will be the output of the following Python code snippet?
d = {“john”:40, “peter”:45}
“john” in d
(i) True
(ii) False
(iii) None
(iv) Error
1
27 What will be the output of the following Python code snippet?
d1 = {“john”:40, “peter”:45}
d2 = {“john”:466, “peter”:45}
1

Page 37 of 42
d1 == d2
(a) True
(b) False
(c) None
(d) Error
28 What will be the output of the following Python code snippet?
d1 = {“john”:40, “peter”:45}
d2 = {“john”:466, “peter”:45}
d1 > d2
(a) True
(b) False
(c) Error
(d) None
1
29 What will be the output of the following Python code snippet?
d = {“john”:40, “peter”:45}
d[“john”]
(a) 40
(b) 45
(c) “john”
(d) “peter”
1
30 Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what
command do we use?
(a) d.delete(“john”:40)
(b) d.delete(“john”)
(c) del d[“john”]
(d) del d(“john”:40)
1
31 Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in
dictionary which command do we use?
(a) d.size()
(b) len(d)
(c) size(d)
(d) d.len()
1
32 What will be the output of the following Python code snippet? 1

Page 38 of 42
d = {“john”:40, “peter”:45}
print(list(d.keys()))
(a) [“john”, “peter”]
(b) [“john”:40, “peter”:45]
(c) (“john”, “peter”)
(d) (“john”:40, “peter”:45)
33 Suppose d = {“john”:40, “peter”:45}, what happens when we try to
retrieve a value using the expression
d[“susan”]?
(a) Since “susan” is not a value in the set, Python raises a KeyError
exception
(b) It is executed fine and no exception is raised, and it returns None
(c ) Since “susan” is not a key in the set, Python raises a KeyError
exception
(d) Since “susan” is not a key in the set, Python raises a syntax error
1
34 What will be the output of the following Python code snippet?
a={1:”A”,2:”B”,3:”C”}
for i,j in a.items():
print(i,j,end=” “)
(a) 1 A 2 B 3 C
(b) 1 2 3
(c) A B C
(d) 1:”A” 2:”B” 3:”C”
1
35 What will be the output of the following Python code snippet?
a={1:”A”,2:”B”,3:”C”}
print(a.get(1,4))
(a) 1
(b) A
(c) 4
(d) Invalid syntax for get method
1
36 What will be the output of the following Python code?
a={1:”A”,2:”B”,3:”C”}
1

Page 39 of 42
a.clear()
print(a)
(a) None
(b) { None:None, None:None, None:None}
(c) {1:None, 2:None, 3:None}
(d) { }
37 Which of these about a dictionary is false?
(a) The values of a dictionary can be accessed using keys
(b) The keys of a dictionary can be accessed using values
(c) Dictionaries aren’t ordered
(d) Dictionaries are mutable
1
38 Which of the following is not a declaration of the dictionary?
(a) {1: ‘A’, 2: ‘B’}
(b) dict([[1,”A”],[2,”B”]])
(c) {1,”A”,2”B”}
(d) { }
1
39 What is the output of the following code?
a={1:”A”,2:”B”,3:”C”}
for i,j in a.items():
print(i,j,end=” “)
(a) 1 A 2 B 3 C
(b) 1 2 3
(c ) A B C
(d) 1:”A” 2:”B” 3:”C”
1
40 Keys of the dictionary must be :
(a) Similar
(b) Unique
(c) Can be similar or unique
(d) All of these

Page 40 of 42
ANSWER KEY
INTRODUCTION TO COMPUTER SYSTEM, EVOLUTION OF COMPUTER &
INPUT /OUTPUT DEVICES
1 a 11 b 21 a 31 A
2 c 12 a 22 b 32 C
3 d 13 b 23 b 33 D
4 a 14 a 24 d 34 C
5 a 15 a 25 a 35 b
6 d 16 a 26 b 36 c
7 b 17 c 27 d 37 b
8 d 18 c 28 b 38 b
9 a 19 b 29 a 39 b
10 a 20 d 30 d 40 c
COMPUTER MEMORY AND SOFTWARE
1 b 11 b 21 b 31 b
2 c 12 a 22 b 32 c
3 a 13 a 23 c 33 b
4 b 14 b 24 a 34 a
5 d 15 d 25 b 35 a
6 d 16 b 26 d 36 a
7 d 17 a 27 a 37 a
8 a 18 a 28 b 38 b
9 b 19 b 29 c 39 c
10 c 20 c 30 a 40 a
PYTHON PROGRAMMING FUNDAMENTALS
1 a) 11 c) 21 b) 31 a)
2 b) 12 c) 22 c) 32 d)
3 b) 13 b) 23 a) 33 c)
4 c) 14 d) 24 b) 34 c)
5 d) 15 b) 25 d) 35 c)
6 d) 16 c) 26 b) 36 c)
7 d) 17 d) 27 a) 37 b)
8 c) 18 a) 28 c) 38 a)
9 a) 19 a) 29 c) 39 b)
10 b) 20 c) 30 b) 40 b)

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Exit mobile version