Python Programming Basics for Class XI
Python Programming Basics for Class XI
3. ____, _____, _____ and ____ are the four pillars of computation thinking.
6. _____ is a step-by-step procedure designed to perform an operation which will lead to the
desired result.
a) Flowchart b) Algorithm c) Pseudocode d) None of these
11. The symbol used for processing in the flow charts is ______
a) b) c) d)
pg. 1
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
12. The symbol used for inputs and outputs in flow charts is
a) b) c) d)
18. In which direction does the control flow in case of a flow chart?
a) Top to Bottom b) Bottom to Top c) Any direction d) Machine Dependent
19. When an algorithm is tested on papers by taking some sample inputs to check if the required
output is obtained is called _____
a) Run b) Dry Run c) Data Sharing d) none of these
pg. 2
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
24. Keep the statement language ____ while using a pseudo code.
a) dependent b) independent c) case sensitive d) capitalized
25. Capitalize initial keyword – This is a rule while writing a pseudo code.
a) True b) False c) machine dependent d) error
29. A search algorithm takes ____ as an input and returns ___ as an output.
a) input, output b) problem, solution
c) solution, problem d) parameters, sequence of actions
pg. 3
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
12.
13.
14.
15. Pseudocode
16. Computational thinking
17. COMPUTE
18. Top to Bottom
19. Dry Run
20. any time to design solutions to problems
21. oval
22. as syntax
23. repetition
24. independent
25. True
26. program
27. define a problem
28. design a solution
29. problem, solution
30. all of above
pg. 4
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
3. Name the built-in mathematical function that is used to return an absolute value of a number.
8. IDLE is a _____________________ .
pg. 5
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
13. All the programs in Python are saved with the ____ extension.
a) .py b) .pyw c) both a & b d) none of these
15. A variable can hold values of different types at different times is known as .
16. The print( ) without any value or name or expression print a blank line (True/False).
17. In Python, the floating point numbers have precision of ___ digits.
a) 12 b) 13 c) 14 d) 15
18. Identifier name cannot be composed of special characters other than ____
a) # b) hyphen (-) c) $ d) underscore( _ )
19. Python takes ____ idented spaces after the function declaration by default.
a) 5 b) 6 c) 4 d) 3
pg. 6
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
25. The address of the object can be checked using ____ method.
a) address( ) b) id( ) c) type( ) d) print( )
29. Each object is Python has three key attributes are ____ , _____ and _____.
30. In Python, the non-zero value is treated as and zero value is treated as
31. The two statements X = int(22.0/7) and X = int(22/7.0) yield the same results (True/False).
a) True b) False c) Machine dependent d) none of these
34. What is the difference between the two statements? T = (0), T=(0,)
pg. 7
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
print(type(True) = = type(False))
a) True b) False c) True d) False
True True False False
pg. 8
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
pg. 9
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. 2hundred
2. for, while, if, elif
3. abs() or fabs( )
4. <class ‘int’>
5. Total & _Data
6. Open source
7. Guido Van Rossum, 1991
8. All of the above
9. simple, Integrated Development Learning Environment
10. Interactive
11. True
12. >>>
13. both a & b
14. #
15. Dynamic typing
16. True
17. 15
18. underscore( _ )
19. 4
20. can be of any length
21. both a & b
22. both a & b
23. Literal
24. F5
25. id( )
26. escape sequences
27. \
28. \t
29. type, a value and an id
30. true
false.
31. True
32. False
pg. 10
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
33. It can run equally well on variety of platforms such as windows, Linux, Unix etc.
34. T= (0) – create a variable with value 0, T=(0,)– create a tuple t with single element 0
35. Tokens
36. You tube, Google, Quora, Instagram
37. True
True
38. “Hello’ & {Hello}
39. Function
40. 13 4+9
41. (-3 + 8.9j)
42. input ( ) – reads the input and returns a python type like list, tuple, int etc.
raw_input( ) – reads the input and returns a string.
43. Punctuator
44. math
45. None
46. round(45.8)
47. print ( )
48. (x**y)%z
49. False
50. 4.57
51. False
52. Lowercase
pg. 11
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
2. Given a function that does not return any value. What value is thrown by default when
executed in shell?
a) int b) bool c) void d) None
6. In order to store values in terms of key and value, we use what core data type?
a) list b) dictionary c) tuples d) class
7. In Python we do not specify types, it is directly interpreted by the compiler, so consider the
following operation to be performed.
>>> X = 13 ? 2
Objective is to make sure X has a integer value, select all that apply.
pg. 12
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
11. ______ data type is used to signify the absence of value/condition evaluating to false in a
situation.
a) Pass b) None c) none d) both b & c
17. The process of arranging the array elements in a specified order is termed as ____
a) indexing b) slicing c) sorting d) traversing
pg. 13
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
18. ____ function is to find the occurrence of a string within another string.
a) find b) count c) append d) sort
23. Suppose a list with name arr contains 5 elements. You can get the 2nd element from the list
using.
a) arr[-2] b) arr[2] c) arr[-1] d) arr[1]
27. What will be the data type of x after the following statement?
x = {‘lang’ ‘python’, ‘version’ 3}
a) list b) set c) dictionary d) tuple
28. What will be the data type of x after the following statement?
x = {2018, 2019, 2020, 2021}
a) list b) set c) dictionary d) tuple
pg. 14
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. class
2. None
3. he
4. int
5. list
6. dictionary
7. all
8. float(‘12+34’)
9. list
10. all
11. None
12. def
13. unique
14. len( )
15. True
16. 11 16 15
17. sorting
18. find
19. str(9/0)
20. -1
21. float(x)
22. list is mutable, tuple is immutable
23. arr[1]
24. list of tuples
25. set
26. int
27. dictionary
28. set
pg. 15
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
Topic 4 Operators
5. The expression int(X) implies that the variable X is converted to integer. State True or False
a) True b) False c) both d) none of these
8. Operators with the same precedence are evaluated for which manner?
a) Left to Right b) Right to Left c) Can’t predict d) none of these
pg. 16
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
10. Which one of the following has the highest precedence in the expression?
a) Exponential b) Addition c) Multiplication d) Parentheses
12. Which of the following output has its associating from right to left?
a) + b) // c) % d) **
pg. 17
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
23. Evaluate 6 * 3 + 4 ** 2 // 5 - 8
25. When evaluating an expression involving ____ operator, the second sub-expression is
evaluated only, if the first sub-expression yields False.
a) or b) and c) not d) none of these
26. When evaluating an expression involving ____ operator, the second sub-expression is
evaluated only, if the first sub-expression yields True.
b) or b) and c) not d) none of these
27. When relational operators are applied in strings, strings are compared from _____
a) left to right b) right to left c) both d) none of these
28. ______ truncated the fractional remainders and gives only the whole part of the result.
a) integer division b) floor division c) modulus d) none of these
pg. 18
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
X, Y = Y, X+2
print(X, Y)
a) 2 6 b) 4 6 c) 6 4 d) 6 2
pg. 19
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
43. In logical operators, ____ operator has higher precedence than ____ operator.
a) and, or b) not, and c) not, or d) all
44. ____ function is used to evaluate the value of the string and returns the numeric result.
a) eval( ) b) int( ) c) str( ) d) type( )
45. The statement b = str1 > str2 shall return ____ as the output if two strings str1 and
str2 contains “Delhi” and “New Delhi”
a) True b) Delhi c) New Delhi d) False
50. How many binary operators are in the following arithmetic expression?
-6 + 10 / (23 + 56)
a) 2 b) 3 c) 4 d) 5
pg. 20
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. X**Y
2. //
3. -1
4. 3
5. True
6. i, ii, iii, iv, v, vi
7. False
8. Left to Right
9. Addition & Subtraction
10. Parentheses
11. 7
12. **
13. 44
14. (6.0,16.0)
15. 512, 64, 512
16. 8.0
17. False
18. -
19. y
20. error
21. (5,6,7,8) <class ‘tuple’>
22. True
True
23. 13
24. = =
25. or
pg. 21
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
26. and
27. left to right
28. floor division
29. 6 4
30. False
31. =
32. %
33. 5
34. -9.3
35. 2
36. -2
37. +
38. unary
39. arithmetic, relational
40. True
41. True
42. False
43. all
44. eval( )
45. False
46. in, not in
47. is, is not
48. Yes, it will create a new list
49. *
50. 3
pg. 22
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
3. Evaluate A =16, B = 15 if A % B // A
a) 0.0 b) 0 c) 1.0 d) 1
pg. 23
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
pg. 24
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
19. Which is the following expressions involves coercion (implicit conversion) when
evaluated in Python?
a) 4.7 – 1.5 b) 7.9 * 6.3 c) 1.7 % 2 d) 3.4 + 4.6
26. Which of the following four code fragments will yield following output?
Eina
Mina
Dika
Select all of function calls that result in this output
a) print(“Eina b) print(“Eina c) print(“Eina\nMina\nDika”)
\n Mina Mina
\n Dika”) Dika”)
d) print(“EinaMinaDika”)
pg. 25
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a+b
33. The equivalent expression in Python for √ a + is _____
b
a) ([Link](a) + a + b) / b b) [Link](a) + (a + b) / b
c) [Link](a) / b + a + b d) [Link](a) / b + (a + b)
pg. 26
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
39. Multiline comments can be done by adding ____ on each end of comment.
40. The expression that requires type conversion when evaluated is _____
a) 4.7 * 6.3 b) 1.7 % 2 c) 3.4 + 4.6 d) 7.9 * 6.3
pg. 27
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
49. Study the following program. What is the output of the following?
print(‘It\’s ok, don\’t worry’)
a) It’s ok, don’t worry b) It\’s ok, don\’t worry c) SyntaxError d) ValueError
pg. 28
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. X*Y
2. 27
3. 0
4. 15
5. (8 / 4) / 2
6. (6.0, 27.0)
7. 85.0
8. Int
9. False
10. print(“hello-“ + “how-are-you”)
11. K = 2 + 3I
12. float
13. -5
14. +5
15. a b c = 1000 2000 3000
16. 1
17. 2.0
18. 27.2
19. 1.7 % 2
20. (1,3)
21. 4.0
22. True
False
23. 2
24. 1
25. string
26. print(“Eina\nMina\nDika”)
27. in
28. “1” + 2
pg. 29
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
29. 34
30. -7 7
31. 2
32. expressions
33. [Link](a) + (a + b) / b
34. [Link](x**5 + y**4 + z**3)
[Link]([Link](x,5) + [Link](y,4) + [Link](z,3))
35. 65536
36. 0
None
37. 8.0
38. 27.2
39. triple quotes (“ “ “ )
40. 1.7 % 2
41. Newline
42. expression
43. True
44. \nPython\ncode
45. 33
46. -18
47. 1.0
48. P y t h o n
49. It’s ok, don’t worry
50. 1 2 1 2
pg. 30
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
Topic 6 Errors
pg. 31
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
9. What is a bug?
pg. 32
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
18. When will the else part of the try-except -else be executed?
a) always b) when an exception occurs
c) when no exception occurs d) when an exception occurs in a try block
21. An exception is
a) an object b) a special function c) a special module d) a module
22. A set of statements that will be executed whether an exception is thrown or not?
a) except b) else c) finally d) assert
27. What will the output of the following code, if the time module has already been imported?
4 + ‘3’
pg. 33
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
28. Compare the following two Python codes shown below and state the output if the input
entered in each case is -6?
Code1
import math
n = int(input(“Enter a number”))
print([Link](n))
Code 2
n = int(input(“Enter a number”))
print([Link](n))
a) ValueError, NameError b) AttributeError, ValueError
c) NameError, TypeError d) TypeError, ValueError
31. In the Python programming language, syntax error is detected by ___ at ____.
a) Interpreter/compile time b) Run time/Interpreter
c) Interpreter/Runtime d) compile time/run time
pg. 34
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. NameError
2. ‘hello2hello2’
3. Syntax Error
4. ZeroDivisionError
5. Syntax Error
6. Debugging
7. Exceptions
8. exception handling
9. A bug is an error in code.
10. It handles an exception i.e. this set of code is executed if an exception occurs.
11. Logical
12. TypeError ‘tuple’ object does not support item assignment.
13. ValueError not enough values to unpack (expected 4, got 3)
14. Name Error
15. error [NameError]
16. ZerodivisionError
17. more than zero
pg. 35
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
2. A loop that contains another loop inside its body is called ___________
pg. 36
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
6. Indentation while working with blocks is not necessary in Python (True / False)
a) True b) False c) Machine dependent d) none of these
13. The logical expression to represent mark is greater than or equal to 100 but less than 70
a) mark>=100 b) mark>=100 and mark<70 c) mark>=100and mark>70 d) none
pg. 37
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a) 20 b) 30 c) 10 d) 40
a) 15 b) yes c) equal d) no
pg. 38
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a) No output b) error c) 0 d) -3
a) None b) yes c) no d) 0
pg. 39
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a) None b) yes c) no d) 0
a) None b) yes c) no d) 0
28. What keyword would you use to add an alternative condition to an if statement?
a) else if b) elseif c) elif d) none of these
pg. 40
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
1. False
True
2. nested loop
3. pass
4. if
5. 101
6. False
7. False
8. (place = = “Delhi” or place = = “Goa”) and place ! = “Jaipur”
9. Name = = “Vivek” and age> = 18 and age < = 35
10. OK
11. 11 13 15 17 19
12. 8
6
pg. 41
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
10
13. mark>=100 and mark<70
14. flow of control
15. ok
average
16. vellous and Ma
17. :
18. 20
19. no
20. not false
21. false
22. absolute value
23. 0
24. yes
25. no
26. yes
27. if a >= 2
28. elif
29. yes
30. False
4. A loop that contains another loop inside its body is called __________
a) endless loop b) infinite loop c) nested loop d) none of these
pg. 42
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
7. The _______ function of Python generates a list which is a special sequence type.
8. ________ statement skis the rest of the loop and jumps over to the statement following the
loop.
a) break b) continue c) both d) none of these
9. Use the Python range( ) function to create the following list [ 7, 3, -1, 5]
pg. 43
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
pg. 44
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
pg. 45
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a) 0 1 2 3 b) 0 1 2 2 c) 3 3 3 3 d) error
pg. 46
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
39. By default, then range of values in for loop starts from ____ in every iteration.
a) – 1 b) 0 c) 1 d) none of these
pg. 47
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
43. What are the correct ways to generate numbers from 0 to 20?
a) range(20) b) range(0,21) c) range(21) d) range(0,20)
pg. 48
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
a) 1 1 2 2 b) 1 1 2 2 3 3 4 4 c) 1 2 3 4 d) 1 2 1 2 1 2
pg. 49
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
7. range( )
8. break
9. range(7, -6, -4)
10.
11.
12. no output
13. infinite
14. 1 2 3 4
15.
16. 6 2
17. -100 * 0 * 100
18.
19. no output
20. error
21. error
22. No output
23. a aaa
24. none of these
25. no output
26. error
27. 0 1
28. 0 1 2
29. m,y, ,n,a,m,e, ,i,s, ,X,X,X,
30. 17 times
31. 0 1 2 2
32. my,name,is,XXX,
33. 5 times
34. continue
35. infinite
36.
pg. 50
Vivekananda Educational Society
MCQ Study material – Computer Science – Class XI
Unit II Computational Thinking and Programming - I (Python)
37. for
38. while
39. 0
40. pass
41. 6 6 6 6 6 6 6 6 6 6 6
42. 26 45
43. range(0,21)& range(21)
44.
45. 1,3,5,7,9,11,
46. 1,2,3,4,5,
47.
48.
49.
50. 1 2 1 2 1 2
pg. 51