Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 477 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

251.

print(a)

A. 10
B. 25
C. junk value
D. error
Answer» C. junk value
252.

What happens if a local variable exists with the same name as the global variable you want to access?

A. error
B. the local variable is shadowed
C. undefined behavior
D. the global variable is shadowed
Answer» E.
253.

On assigning a value to a variable inside a function, it automatically becomes a global variable.

A. true
B. false
Answer» C.
254.

Which of the following data structures is returned by the functions globals() and locals()?

A. list
B. set
C. dictionary
D. tuple
Answer» D. tuple
255.

(1,2) print(total)

A. error
B. 7
C. 8
D. 15
Answer» C. 8
256.

,2,3,4 f(5,10,15)

A. 1 2 3 4
B. 5 10 15 4
C. 10 20 30 40
D. 5 10 15 40
Answer» D. 5 10 15 40
257.

(2,[3,4]))

A. [3,2,4]
B. [2,3,4]
C. error
D. [3,4,2]
Answer» E.
258.

f1()

A. error
B. 12
C. 15
D. 1512
Answer» D. 1512
259.

How are default arguments specified in the function heading?

A. identifier followed by an equal to sign and the default value
B. identifier followed by the default value within backticks (“)
C. identifier followed by the default value within square brackets ([])
D. identifier
Answer» B. identifier followed by the default value within backticks (“)
260.

What is the value stored in sys.argv[0]?

A. null
B. you cannot access it
C. the program’s name
D. the first argument
Answer» D. the first argument
261.

Which module in the python standard library parses options received from the command line?

A. getopt
B. os
C. getarg
D. main
Answer» B. os
262.

What is the type of sys.argv?

A. set
B. list
C. tuple
D. string
Answer» C. tuple
263.

How are variable length arguments specified in the function heading?

A. one star followed by a valid identifier
B. one underscore followed by a valid identifier
C. two stars followed by a valid identifier
D. two underscores followed by a valid identifier
Answer» B. one underscore followed by a valid identifier
264.

): print(foo(i))

A. [0] [1] [2]
B. [0] [0, 1] [0, 1, 2]
C. [1] [2] [3]
D. [1] [1, 2] [1, 2, 3]
Answer» C. [1] [2] [3]
265.

, 2, 3])

A. 3 1
B. 1 3
C. error
D. none of the mentioned
Answer» B. 1 3
266.

How many keyword arguments can be passed to a function in a single function call?

A. zero
B. one
C. zero or more
D. one or more
Answer» D. one or more
267.

How are keyword arguments specified in the function heading?

A. one-star followed by a valid identifier
B. one underscore followed by a valid identifier
C. two stars followed by a valid identifier
D. two underscores followed by a valid identifier
Answer» D. two underscores followed by a valid identifier
268.

What is the length of sys.argv?

A. number of arguments
B. number of arguments + 1
C. number of arguments – 1
D. none of the mentioned
Answer» C. number of arguments – 1
269.

What is the type of each element in sys.argv?

A. set
B. list
C. tuple
D. string
Answer» E.
270.

',B='2')

A. string
B. tuple
C. dictionary
D. an exception is thrown
Answer» D. an exception is thrown
271.

If a function doesn’t have a return statement, which of the following does the function return?

A. int
B. null
C. none
D. an exception is thrown without the return statement
Answer» D. an exception is thrown without the return statement
272.

,2,3,4)

A. integer
B. tuple
C. dictionary
D. an exception is thrown
Answer» C. dictionary
273.

, i = 2)

A. an exception is thrown because of conflicting values
B. 1 2
C. 3 3
D. 3 2
Answer» E.
274.

What is a variable defined inside a function referred to as?

A. a global variable
B. a volatile variable
C. a local variable
D. an automatic variable
Answer» D. an automatic variable
275.

What is a variable defined outside a function referred to as?

A. a static variable
B. a global variable
C. a local variable
D. an automatic variable
Answer» C. a local variable
276.

min(101*99, 102*98)

A. 9997
B. 9999
C. 9996
D. none of the mentioned
Answer» D. none of the mentioned
277.

who('Arthur')

A. arthur sir
B. sir arthur
C. arthur
D. none of the mentioned
Answer» C. arthur
278.

f(2, 30, 400)

A. 432
B. 24000
C. 430
D. no output
Answer» B. 24000
279.

Lambda contains block of statements.

A. true
B. false
Answer» C.
280.

Lambda is a statement.

A. true
B. false
Answer» C.
281.

print z(8)

A. 48
B. 14
C. 64
D. none of the mentioned
Answer» B. 14
282.

Python supports the creation of anonymous functions at runtime, using a construct called

A. lambda
B. pi
C. anonymous
D. none of the mentioned
Answer» B. pi
283.

Does Lambda contains return statements?

A. true
B. false
Answer» C.
284.

print x

A. 9
B. 3
C. 27
D. 30
Answer» D. 30
285.

Which of the following refers to mathematical function?

A. sqrt
B. rhombus
C. add
D. rhombus
Answer» B. rhombus
286.

Which of the following is the use of id() function in python?

A. id returns the identity of the object
B. every object doesn’t have a unique id
C. all of the mentioned
D. none of the mentioned
Answer» B. every object doesn’t have a unique id
287.

What is called when a function is defined inside a class?

A. module
B. class
C. another function
D. method
Answer» E.
288.

Where is function defined?

A. module
B. class
C. another function
D. all of the mentioned
Answer» E.
289.

What are the two main types of functions?

A. custom function
B. built-in function & user defined function
C. user function
D. system function
Answer» C. user function
290.

Which are the advantages of functions in python?

A. reducing duplication of code
B. decomposing complex problems into simpler pieces
C. improving clarity of the code
D. all of the mentioned
Answer» E.
291.

Which of the following is a feature of DocString?

A. provide a convenient way of associating documentation with python modules, functions, classes, and methods
B. all functions should have a docstring
C. docstrings can be accessed by the     doc      attribute on objects
D. all of the mentioned
Answer» E.
292.

print(maximum(2, 3))

A. 2
B. 3
C. the numbers are equal
D. none of the mentioned
Answer» C. the numbers are equal
293.

printMax(3, 4)

A. 3
B. 4
C. 4 is maximum
D. none of the mentioned
Answer» D. none of the mentioned
294.

Which keyword is used for function?

A. fun
B. define
C. def
D. function
Answer» D. function
295.

Which of the following is the use of function in python?

A. functions are reusable pieces of programs
B. functions don’t provide better modularity for your application
C. you can’t also create your own functions
D. all of the mentioned
Answer» B. functions don’t provide better modularity for your application
296.

, 4, 6])

A. 4
B. 3
C. error
D. 6
Answer» B. 3
297.

Which of the following functions does not throw an error?

A. ord()
B. ord(‘ ‘)
C. ord(”)
D. ord(“”)
Answer» C. ord(”)
298.

Which of the following functions will not result in an error when no arguments are passed to it?

A. min()
B. divmod()
C. all()
D. float()
Answer» E.
299.

Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?

A. reverse(l)
B. list(reverse[(l)])
C. reversed(l)
D. list(reversed(l))
Answer» E.
300.

Which of the following functions accepts only integers as arguments?

A. ord()
B. min()
C. chr()
D. any()
Answer» D. any()