Python MCQ - Basics
Python MCQ - Basics
c.
d.
3. Software that translates and executes a high level language program in one line CO1/R
at a time is known as
a. a Compiler
b. an Interpreter
c. an Assembler
d. an Executor
a. sequence
b. case
c. repetition
d. process
10. In which of the following only one flow line is used ? CO1/U
a. Process
b. Terminal
c. Decision Making
d. I/O
12. The time complexity of the solution tower of hanoi problem using recursion is CO1/R
_________
a. O(n2)
b. O(2n)
c. O(n log n)
d. O(n)
15. Minimum number of moves required to solve a tower of hanoi problem with n CO1/U
disks is __________
a. 2n
b. 2n-1
c. n2
d. n2-1
17. What is the name for the software used to convert an assembly language CO1/R
program into machine code?
a. Assembler
b. Interpreter
c. Compiler
d. Translator
18. Suppose a list has values [3,4,5,67,78] then what is the index value of 5 CO1/U
a. 2
b. 3
c. 4
d. 1
19. Which of the following is used to represents the information entering or leaving CO1/U
the system?
e. Decision
f. Subfuncion
g. Initialization
h. I/O
20. Keep the statement language ______________ while writing a pseudo code. CO1/R
Fill in the blank with suitable choice.
a. dependent
b. independent
c. case sensitive
d. capitalized
BEGIN CO1/A
31.
GET n
INITIALIZE i=1
-------------
-------------
-------------
ENDWHILE
END
In this Pseudocode which finds the square of a number,choose the correct
missed statements.
a. WHILE(i<=n) DO
PRINT i*i*i
i=i+2
b. WHILE(i<=n) DO
PRINT i*i
i=i+2
c. WHILE(i>=n) DO
PRINT i*i
i=i+2
d. WHILE(i<=n) DO
PRINT i*i
i=i+1
CO1/A
32. Minimum time required to solve Tower of Hanoi puzzle with 4 disks will be
__________ (assuming that one move takes 2 seconds)
a. 15 seconds
b. 30 seconds
c. 16 seconds
d. 32 seconds
CO1/A
33. Choose the condition which is used to prove n = 7 is an positive number .
a. if(n< 0)
b. if(n>=0)
c. if(n>0)
d. if(n==0)
CO1/A
34. Choose the condition which is used to prove num=6 is an even number.
a. if(num%2==0)
b. if(num/2==0)
c. if(num%2=0)
d. if(num%2!=0)
CO1/A
35. Choose the output of this Program.
age=20
If(age>=18):
print(“eligible for voting”)
else:
print(“not eligible for voting”)
How will you change the above algorithm to find Maximum element in a List?
a. SET MAX = E
b. IF E > MIN THEN
c. IF E < MAX THEN
d. INCREMENT i by TWO
CO1/A
42. “Guess an Integer Number in a Range” Problem the Range value is 1 to 100.
How many guesses it takes to find the guessed number?
a. 8
b. 7
c. 4
d. 10
CO1/A
43.
45. In Tower of Hanoi problem,if the Number of disks=4 then how many moves it CO1/A
needed?
a. 8
b. 4
c. 15
d. 16