Python English. - January 2023
Python English. - January 2023
11. Structured program can be broken into ………. To assign to more than one developer.
(A) Segments
(B) Modules
(C) Units
(D) All of the above
18. Python supports the creation of anonymous functions at runtime, using a construct called ………….?
(A) Pi
(B) anonymous
(C) lambda
(D) None of the above
19. What is the output of the following code?
M=[’b’ *x for x in range(4)]
Print(M)
(A) [‘’,‘b’,’bb’’bbb’]
(B) [‘b’,’bb’’bbb’’bbbb’]
(C) [‘b’,’bb’’bbb’]
(D) None of these
27. To use a module in another module, you most import it using an …….. statement.
(A) import
(B) include
(C) both (A) and (B)
(D) none of the above
29. A ………. Statement is used when a statement is required syntactically but you do not want any code
to execute.
(A) break
(B) pass
(C) continue
(D) none of these
39. A ………. Stores information in the form of a stream of ASCII or Unicode characters i.e. human
readable.
(A) Text file
(B) Binary file
(C) Both (A) and (B)
(D) None of these
41. In Python language, which of the following operators option for raising k to the power 1 ?
(A) K^1
(B) K**1
(C) K^^1
(D) K^*1
46. Which of the following are valid string manipulation functions in Python?
(A) count()
(B) upper()
(C) strip()
(D) All of the above
(A) 12
(B) 11
(C) 11.0
(D) None of these
48. Which statement will move file pointer 10 bytes backward from current position?
(A) f.seek(-10,0)
(B) f.seek(10,0)
(C) f.seek(-10,1)
(D) None of the above
49. Which of the following error is returned when we try to open a file in write mode which does not
exist?
(A) File Found Error
(B) File Not Exist Error
(C) File Not Found Error
(D) None of the above
50. What will be the output of the following Algorithm for a=5, b=8, c=6\
Step 1 : Start
Step 2 : Declare variables a, b and c.
Step 3 : Read variables a, b and c.
Step 4 : If a < b
If a < c
Display a is the smallest Number.
Else
Display c is the smallest Number.
Else
If b< c
Display b is the smallest Number.
Else
Display c is the smallest Number.
Step 5 : Stop
60. What is the use of the zeros () function in numpy array in Python\
(A) To make a Matrix with all element 0
(B) To make a Matrix with all diagonal element 0
(C) To make a Matrix with first row 0
(D) None of the above
(A) a B C D
(B) a b c d
(C) error
(D) A B C D
63. Which mode creates a new file if the file does not exist \
(A) Right mode
(B) Read mode
(C) Append mode
(D) Both (A) and (B)
69. 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”])
76. Which statement is correct to import all modules from the package?
(A) From package import all
(B) From package import *
(C) From package include all
(D) From package include *
(A) 0 1 2 0
(B) 0 1 2
(C) 0 0 1 0 2
(D) error
78. When we open file in append mode the file pointer is at the ………. Of the file.
(A) Anywhere in between the file
(B) End
(C) Beginning
(D) Second line of the file
80. The content inside the “for loop” are separated by:
(A) Colon
(B) Comma
(C) Semicolon
(D) Hyphen
85. Which of the following is used to define a block of code in Python language?
(A) Try
(B) Brackets
(C) Indentation
(D) Catch
86. Which of the following will read entire content of file (file object ‘f’)?
(A) f.reads()
(B) f.read()
(C) f.read(all)
(D) f.read(*)
96. Which translator is used to convert assembly language into machine language\
(A) Compiler
(B) Interpreter
(C) Assembler
(D) None of these
tuple1.pop(2)
print(tuple1)
(A) (5,1,6,2)
(B) (5,1,7,6)
(C) (5,1,7,6,2)
(D) Error