Python Basic MCQ for CBSE Class 11

In this section we will learn the python fundamental MCQ for CBSE class 11 Computer Science.  This exercise will also help the students of CBSE Computer Science class 12 students who are appearing in Multiple Choice Question based, Term 1 examination in November/ December 2021.

1. What is the maximum possible length of an identifier?
a) 31 characters
b) 63 characters
c) 79 characters
d) none of the mentioned

d) none of the mentioned

Explanation: Identifiers can be of any length.




 

2. Who developed the Python language?
a) Zim Den
b)Wick van Rossum
c) Guido van Rossum
d) Niene Stom

c) Guido van Rossum

3. In which year was the Python language developed?
a) 1991
b) 1989
c) 1981
d) 1973

a) 1991

4. Which one of the following is the correct extension of the Python file?
a) .py
b) .python
c) .p
d) None of these

a) .py

 

5. Which of the following is an invalid variable?
a) my_string_1
b) 1st_string
c) foo
d) _

b) 1st_string

Explanation: Variable names should not start with a number.

 

6. Which of the following cannot be a variable?
a) __init__
b) in
c) it
d) on

b) in

Explanation: in is a keyword.




7. Which is the correct operator for power(xy)?
a) X^y
b) X**y
c) X^^y
d) None of the mentioned

b) X**y

Explanation: In python, power operator is x**y i.e. 2**3=8.

8. Which one of these is floor division?
a) /
b) //
c) %
d) None of the mentioned

b) //
Explanation: When both of the operands are integer then python chops out the fraction part and gives you the round off value, to get the accurate answer use floor division. This is floor division. For ex, 5/2 = 2.5 but both of the operands are integer so answer of this expression in python is 2. To get the 2.5 answer, use floor division.

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

c) 1

Explanation: Modulus operator gives the remainder. So, 22%3 gives the remainder, that is, 1.

10. What is the output of this expression, 3*1**3?
a) 27
b) 9
c) 3
d) 1

c) 3

Explanation: First this expression will solve 1**3 because exponential has higher precedence than multiplication, so 1**3 = 1 and 3*1 = 3. Final answer is 3.

 

Chapterwise Question Bank CBSE Class 11 Computer Science (Python)

 

#TRENDING

Chapter-1 Basic Computer Organisation MCQs

Chapter-2 Types of Software, Operating System MCQs

Chapter-3 Boolean Algebra, Number System MCQs

Chapter-4 Flow of control, conditional statements MCQs

 

 

11. A function in Python begins with which keyword?
a) void
b) return
c) def
d) int

c) def

12. What do we use to define a block of code in Python language?
a) Key
b) Brackets
c) Indentation
d) None of these

c) Indentation




13. Which character is used in Python to make a single line comment?
a) /
b) //
c) #
d) !

c) #

14. Which of the following declarations is incorrect?
a) _x = 2
b) ____x = 3
c) __xyz__ = 5
d) None of these

d) None of these

15. Which of the following words cannot be a variable in python language?
a) _val
b) val
c) try
d) _try_

c) try

Python Fundamentals Class 11 MCQs

16. Which of the following option is not a core data type in the python language?
a) Dictionary
b) Lists
c) Class
d) All of the above

c) Class

 

17. Which of the following statements assigns the value 25 to the variable x in Python:

a) x ← 25

b) x = 25

c) x := 25

d) int x = 25

b) x=25

 

18. Which one of the following is the correct way of declaring and initializing a variable, x with the value 7?

a) int x
x=7

b) int x=7

c) x=7

d) declare x=7

c) x=7

 

19. In which data type, indexing is not valid?

a) List

b)String

c) Dictionary

d) None of the above

c) Dictionary

 

 

20. Select the correct example of complex datatype in Python

a) 3 + 2j

b) -100j

c) 5j

d) All of the above are correct

d) All of the above are correct

 

 

Also Check: Board Sample Paper for class 12 Computer Science to be held in November/December 2021

 

21. l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

a) List

b) Tuple

c) Set

d) None of these

a) List

 

 

22. How can we create an empty list in python?

a) list=()

b) null

c) list

d) list=[]

d) list=[]

 

 

23. If x=3.123, then int(x) will give ?

a) 1

b) 0

c) 1

d) 3

d) 3

 

 

24. Correct way to declare a variable x of float data type in python:

a) x = 2.5

b) float x = 2.5

c) float(2.5)

d) All of the above

a) x = 2.5




25. In order to store values in terms of key and value we use that core data type in python?

a) List

b) Class

c) Dictionary

d) Tuple

c) Dictionary

 

Python Fundamentals Class 11 MCQs

26. Which statement is true from following-

a) List is mutable & Tuple is immutable

b) List is immutable & Tuple is mutable

c) Both are Mutable.

d) Both are Immutable

a) List is mutable & Tuple is immutable

 

 

27. Identify tuple from the following-

a) [3]

b) {1, 2, 3}

c) (1, 2, 3, 4)

d) None of the Above

c) (1, 2, 3, 4)

 

 

28. Special meaning words of Pythons, fixed for specific functionality are called ………. .

a) Identifiers

b) functions

c) Keywords

d) literals

c) Keywords

 

 

29. Names given to different parts of a Python program are ………. .

a) Identifiers 

b) functions

c) Keywords

d) literals

a) Identifiers

 

30. Data items having fixed value are called ………. .

a) Identifiers

b) functions

c) Keywords

d) literals

d) literals

31. Which of the following is/are correct ways of creating strings ?

a) name = Jiya

b) name = ‘Jiya’ 

c) name = “Jiya” 

d) name = (Jiya)

b) name = ‘Jiya’

c) name = “Jiya”




32. Which of the following are keyword(s) ?

a) name

b) Print

c) print

d) input

c) print

d) input

 

 

33. Which of the following are valid identifiers ?

a) my name

b) _myname 

c) 2myname

d) my-name

b) _myname

 

34. Escape sequences are treated as ………. .

a) strings

b) characters

c) integers

d) none of these

b) characters

 

 

35. Which of the following is an escape sequence for a tab character ?

a) \a

b) \t

c) \n

d) \b

b) \t

 

36. Which of the following is an escape sequence for a newline character ?

a) \a

b) \t

c) \n 

d) \b

c) \n

 

37. Which of the following is not a legal integer type value in Python ?

a) Decimal

b) Octal

c) Hexadecimal

d) Roman 

d) Roman

 

38. Which of the following value is not legal in an octal value ?

a) 7

b) 8 

c) 11

d) 0

b) 8

 

39. Which of the following is/are expression(s) ?

a) a+b-5 

b) a

c) -5

d) 0

a) a+b-5 

 

40. The lines beginning with a certain character, and which are ignored by a compiler and not executed, are called ……….

a) operators

b) operands

c) functions

d) comments

d) comments

 

41. Which of the following functions print the output to the console ?

a) Output( )

b) Print( )

c) Echo( )

d) print( )

d) print( )

 

42. Select the reserved keyword in Python.

a) else

b) import

c) print

d) all of these

d) all of these

 

43. The input( ) returns the value as ………. type.

a) integer

b) string

c) floating point

d) none of these

b) string




 

44. To convert the read value through input( ) into integer type, ……….( ) is used.

a) floating

b) float

c) int

d) integer

c) int

 

45. To convert the read value through input( ) into a floating point number, ……….( ) is used.

a) floating

b) float

c) int

d) integer

b) float

 

46. To print a line a text without ending it with a newline, ………. argument is used with print( )

a) sep

b) newline

c) end

d) next

c) end

47. The default separator character of print( ) is ……….

a) tab

b) space

c) newline

d) dot

b) space

 

 

48. Python is____

a) High-Level

b) Interpreted

c) Object-Oriented

d) All Of  The Above

d) All Of  The Above

 

 

49. Which symbol denotes the python prompt?

a)  >>>

b)  #

c)  ”’

d) //

a)  >>>

 

50. Which of the following is a valid string literal?

a) “PythonMcq”

b) ‘PythonMcq’

c) ”’PythonMcq”’

d) All of these

ANSWER= (C) All of these
Explanation:- Option A and B are single-line strings literal and option C is a multi-line string literal.

 




51. Which line of code produces an error?

a) “PythonMcq” + “12”

b) ‘PythonMcq’ + 16

c) 3 + 7

d) ‘PythonMcq’ + “21”

ANSWER= (B) ‘PythonMcq’ + 16
Explanation:-Concatenation does not exist between two different data types.

 

52. How many keywords present in the python programming language?
a) 32
b) 61
c) 33
d) 27

c) 33

53. Which of the following keywords is not reversed keyword in python?
a) None
b) class
c) goto
d) and

c) goto

54. More than one value(s) can be returned by a function in Python.
a) True
b) False

a) True

55. The variable declared inside a function is called a global variable.
a) True
b) False

b) False

Python Fundamentals Class 11 MCQs

56. Once a function is defined, it may be called only once from many different places in a program.
a) True
b) False

b) False

57. Value returning functions should be generally called from inside of an expression.
a) True
b) False

a) True

58. A local variable having the same name as that of a global variable hides the global variable in its function.
a) True
b) False

a) True

 

59. Python passes parameters by reference.
a) True
b) False

b) False

 

60. Parameters specified within a pair of parentheses in the function definition are the actual parameters or non-formal parameters.
a) True
b) False

b) False

61. A function in Python is used by invoking it via a function call.
a) True
b) False

a) True

 

62. Functions that do not return any value are known as
a) fruitful functions
b) void functions
c) library functions
d) user-defined functions

b) void functions

63. A variable created or defined within a function body is classified as-
a) local
b) global
c) instance
d) build-in

a) local

64. Name the statement that sends back a value from a function.
a) print
b) return
c) input
d) none

b) return

65. Which values are used by the functions to communicate information back to the caller?
a) local
b) global
c) random
d) return

d) return

 

SQL MCQs for Class 12

Comments are closed.

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved