### iitm computr education mathura

1.The output of the following code.
string=”my name is x”
for i in string:
print(i,end=”,”)
A. m,y,,n,a,m,e,,i,s,x,
B. m,y,,n,a,m,e,,i,s,x
C. my,name,is,x
D. None

2. What arithmetic cannot be used with strings?
A. +
B. *
C. –
D. All of the mentioned

3. The output of the following code.
string=”my name is x”
for i in string.split():
print(i,end=”, ”)
A. m,y,,n,a,m,e,,i,s,,x,
B. m,y,,n,a,m,e,,I,s,,x
C. my,name,is,x,
D. Error

4. The output of the following code.

a=[0,1,2,3]
for a[-1] in a:
print(a[-1])

A. 0 1 2 3
B. 0 1 2 2
C. 3 3 3 3
D. error

5. The output of the following code.

a=[0,1,2,3]
for a  in a:
print(a)

A. 0 1 2 3
B. 0 1 2 2
C. 0 2 3 4
D.Error

6. The output of the following code.

a=[0,1,2,3]
i= -2
for i in not in a:
print(i)
i+=1

A. -2 -1
B. 0
C. Error
D.None of the mentioned

7. The output of the following code.

>>>”b”+”cde”
A. a
B. cde
C. bcd
D.Bcde

8. The output of the following code.

>>>”abcde”[3 :]

A. ab
B. de
C. cde
D.None

9. The output of the following code.

>>>print(‘new’ ‘line’)

A. error
B. output equialent to print ‘newline’
C. newline
D.new line

10. The output of the following code.

>>>max(“what are you”)

A. u
B. t
C. m
D.K

11. Which of the following statement prints helloexample test.txt?

A. print(“helloexample est.txt”)
B. print(“helloexample test.txt”)
C. print(“hello”example”test.txt”)
D.print(“hello”example “est.txt”)

12. The output of the following code.

print(“xyyzxyzxzxyy”.count(‘yy’))

A. 3
B. 0
C. 2
D.None

13. The output of the following code.

>>>str1=”helloworld”
>>>str1[: : -1]

A. dlrowolleh
B. Hello
C. world
D.Helloworld

14. what is the output of the below program in python:

print(0.2+0.4==0.6)
A. True
B. False
C. Error
D.Depends on machine

15. Which is not a feature of python language.

A. interpreted language
B. portable
C. high level language
D.case insensitive

16. Python is a …………object-oriented programming language.

A. Special purpose
B. General purpose
C. Medium level programming language
D.All of the mentioned above

17. Developer of python programming?

A. Denis Ritchie
B. Y.C Khenderakar
C. Tim Berner Lee
D.Guido van Rossum

18. Which are application areas of python programming?

A. Web development
B. Game development
C. Artificial intelligence and machine learning
D. All of the above

19. What is numeric types of data types?

A. int
B. Float
C. Complex
D.All of the above

20. What is the output for below code?

a = 2
b = 3
print(a,b)
a,b=b,a
print(a,b)

A. 23 23
B. 23 32
C. 32 32
D.None of above

21. List tuple dictionary are which types of datatypes?

A. Binary types
B. Boolean types
C. Sequence types
D.None of the above

22. Which keyword used in python language?

A. Finally
B. Lambda
C. While
D.All of above

23. Python Dictionary is used to store the data in.

A. Key value pair
B. Set value pair
C. Tuple value pair
D.None of the above

24. Which is invalid variable?

A. my_string_1
B. _
C. Foo
D.1st_string

25. What is the output of given code?
4+2**5//10

A. 77
B. 7
C. 3
D.0

26. The python language developed in which?

A. 1995

B. 1989

C. 1972

D.1981

27. Single line comment in python?

A. /
B. //
C. #
D.!

28. Conditional statements are also known as.

A. Decision-making
B. Array
C. List
D.Looping

29. Which is not used as Conditional statement in python?

A. switch
B. if…else
C. elif
D.For

30. which string represent the purpose for which the file is open?

A. “file name”
B. “file handle”
C. “file mode”
D.None of above

Python Model Paper Jan 2023 (OLevel) solved paper set

31. File handle is also know as.

A. File name
B. File variable
C. File object
D.none of above

32. which () finf the current position of file pointer with in file?

A. Seek()
B. Tell()
D.All of above

33. What is packing.

A. it is used for object serialization
B. It is used for object deserialization
C. All of the mentions
D.None of above

34. Eof standed for.

A. End of file
B. End of close
C. End of open
D.None of them

35. Input device.

B. Gps
C. Microphone
D.All of above

36. To reped the list up to a spacify a number of iteam. Which operater required?

A. +

B. *

C. :

D.None

37. What type of data is?

a=[(1,1),(2,5),(3,9)]

A. array of tuple
B. tuples of list
C. List of tuple
D.invalid list

38. What will be print?

Import numpy as np

a = np. array([1,2,3,5,8])

b = np. array([0,3,4,2,1])

c = a+b

c = c*a

print(c)

A. 7
B. 12
C. 10
D. 21

39. import numpy as np.

a = np.array([[1,2,3],[0,1,4]])
print(a.size)

A. 1
B. 5
C. 6
D. 4

40. import numpy as np

a = np.array([1,2,3,5,8])
print(a.ndim)

A. 0
B. 1
C. 2
D. 3

41. Numpy stands for.
A. Numbering Python
B. Number in Python
C. Numerical Python
D. Number Python

42. numpy is used along with package like?

A. Node Js
B. Matplotlib
C. Scipy
D. Both(B)and(C)

43. the sets the size of the buffer used in ufuncs?

A. bufsize(size)
B.setsize(size)
C. set bufsize(size)
D. Size(size)

44. import numpy as np
dt=dt= np.dtype(‘i,4’)
print(dt)

A. int 32
B. int 64
C. int 128
D. int 16

45. if a dimension is given as _ in a reshaping operation, the other dimensions are Automate cally calculated.

A. Zero
B. One
C. Negative one
D. Infinite

46. Testing process first goal.

A. Testing

B. Analysis

C. Bug preventation

D. All of above

47. Sorting means.

A. Arranging the data

B. Processing the data

C. Calegrizing

D.None of above

48. Medium of comonunication.

A. Network
B. Compiler
C. Language
D.All of above

49. Bug means.

A. An insert in the program
B. Data input to the program
C. The error in the program
D.All of the above

50. Identifire maxium possible lenth.

A. 31 character
B. 63 character
C. 79 charater
D.None of the above

51. Which of the following is an invalid variable.

A. my_string_1
B. 5 st_string
C. Too
D.__

52. Which function do you use to read a string?

A. input(“enter a string”)
B. eval(input(“enter a string”))
C. enter(“enter a string”)
D.eval(enter(“enter a string”))

53. What will be the output of the following python code?

print(“abc DEF”.capitalize())

A. abc def
B. ABC DEF
C. Abc def
D. Abc Def

54. What will the output of the following python code?

A. 0.33
B. 0.33%
C. 33.33%
D.33%

55. Which are methods of list?

A. Append()
B. Extend()
C. Insert()
D.All of the above

56. Which keyword used in python language?

A. Finally
B. Lambda
C. While
D.All of above

57. The list.pop([i]) is used for removing the item at the given position in the list?

A. Yes
B. No

58. Which not a keyword in python language?

A. Val
B. Raise
C. Try
D.With

59. The output of below python program is.

X = [‘ab’,’cd’]
print(len(list(map(list,x)))))

A. 1
B. 2
C. Error
D.Not specified

60. In python, the primary use of the tell() method is that:

A. Within the file, it tells the current position
B. Within the file, it tells the end position
C. It tells us if the file is opened
D.None of the above

61. What is output of below python code.
Str = [‘career’, ‘bodh’, ‘sansthan’] ‘ ‘join(str)

A. [‘careerbodhsansthan’]
B. ‘careerbodhsansthan’
C. [‘career bodh sansthan’]
D.‘career bodh sansthan’

62. ---------- is a connector showing the relationship between the representative shapes.

A. Line
B. Arrow
C. Process
D.Box

63. ---------scans the rntire program and translates it as a whole into machine code.

A. Compiler

B. Interpreter

C. Debugger

D.None of above

A. Function name

B. Parameter list

C. Return value

D.Both (a) and (b)

65. Function class defind.

A. Class

B. Function

C. Method

D.Module

66. Recursive function.

A. Function other function call

B. A function which calls itself

C. Both(a) and (b)

D.None of these

67. Python id() use.

A. Id() return the size of object

B. Id() returns the idenity of the object

C. Both(a) and(b)

D.None of above

A. def fun(a=2,b=3,c)

B. def fun(a=2,b,c=3)

C. def fun(a,b=2,c=3)

D.def fun(a,b,c=3,d)

69. how is a function declared in python?

A. def function function_name():

B. declared function function_name()

C. def function_name()

D.declared function_name()

70. packages modules import operator python used.

A. *

B. .

C. ->

D.&

71. Find the output of following python code.

n=[1,2,3,4,5,6,7,8,9]
print(n[-3: -8: -1]

A. 7,6,5,4,3,2

B. 7,6,5,4,3

C. 1,2,3,4,5,6,7

D.Empty

72. What is the output of following string slice.

S= ‘CPPbuzz
print(s[3:5]

A. Pbuzz

B. buzzc

C. bu

D.None

73. Which variable has in vaild statement?

A. abc = 1,000,000

B. a b c = 1000 2000 3000

C. a,b,c = 1000,2000,3000

D.a_b_c = 1,000,000

74. which can be an identify ammag in python?

A. 1abc

B. &12a

C. _xy1

D.@python

75. For loop is also know as.

A. Counting loop

B. Loop

C. Both(A)and(B)

D.None of above

76. The statement written after else is executed when codition is.

A. True

B. False

C. Not lested

D.None

77. In if statement if a>b and a>c, the statement return after else is execute when.

A. Both condition are true

B. Both condition are false

C. Any of conditiion false

D.Any of condition is true

78. What is the output of following python code

a =[13,56,17]
a.append()
a.append([45,67])

A. [13,56,17,87,45,67]

B. [13,56,17,87,[45,67]

C. [13,56,17,,45,67]

D.None

79. reshape() function is numpy array using python is ?

A.reshape (shape)

B.array. reshape (shape)

C.numpy. reshape (array)

D. reshape (array,shape)

80. How to convert numpy array to list?

A. array.list()

B. array. List

C. list. array

D. list (array)

81. Output of following code.

T1 = (1,2,4,3)
T2 = (1,2,3,4)
T1<T2

A. True

B. False

C. Error

D.(1,2,3,4)

82. The name of(+) string operator is.

A. Cocatenation

B. Relational

C. Replication

D.Membership

83. In python string can be enclosed in is.

A. Single quotes

B. Triple quotes

C. Double quotes

D.Any of these

84. The last list of function defination is.

A. exit

B. def

C. return

D. None of these

85. Which function give ASCII code of give ()

A. str()

B. chr()

C. ord()

D.len()

86. To open a file c:\tkd.txt for reading by use.

A. infile=open(“c:\scores.txt”,’I’)

B. infile=open(“c:\\tkd.txt”,’r’)

C. infile=open(file=”c:\score.txt”,’r’)

D.None of above

87. This import * statement import all names in the module except these beginning width.

A. -

B. &

C. %

D.+

88. File write lines() syntax.

A. File write lines (sequence)

B. File object.write lines ()

C. File object. Write lines (sequence)

D.None of the mentions

89. Which () is defined in pickle module and use to write data object in binarry file.

B. Dump()

C. Write()

D.None of these

90. Group function,class,variable,saved as python program file (.py).

A. File

B. Module

C. Package

D.None of above

91. Which of the following is reffred to as top level segement of the python program.

A. _main_

B. _top_

C. _global_

D.None of these

92. What is the output of following code.

import numpy as np
a= np.array ([1,2,3,5,8])
array = ary+1
print(array)

A. 3

B. 2

C. 5

D.Error

93. Software mistake during coding are known as……

A. Error

B. Bugs

C. Failures

D.Defects

94. Python lambda function.

A. True

B. False

C. Lambda is a function in python but user can is it.

D.None of the above

95. Fill () function requeres 2 arguments minimum to pass in it.

A. True

B. False

C. Fill () does’nt belong to numpy

D.All of above

96. In which language is python written?

A. java

B. C++

C. C

D.None of above

97. Craeting ndarry. Which is the built in function in numpy.

A. np.array()

B. np.zero()

C. np.empty()

D.all of the above

98. what will be the output of the following python code

for i in [1,2,3,4] [: : -1]:
print(i)

A. 4 3 2 1

B. 1 2 3 4

C. 2 3 4

D.Error

99. The action performed by a_____structure must eventually cause the loop to terminate.

A. Sequence

B. Case

C. Repetition

D.All of above

100. The hierachy of operations is denoted as___

a) +,-
b)Power
c) *,/
d)\ , Mod

A. a,b,c,d

B. b,d,c,a

C. d,a,c,b

D.b,c,d,a