Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

+9*((3*12)-8)/10

A. 30.0
B. 30.8
C. 28.4
D. 27.2
Answer» E.
2.

+4.00, 2**4.0

A. (6.0, 16.0)
B. (6.00, 16.00)
C. (6, 16)
D. (6.00, 16.0)
Answer» B. (6.00, 16.00)
3.

/4/2, 8/(4/2)

A. (1.0, 4.0)
B. (1.0, 1.0)
C. (4.0. 1.0)
D. (4.0, 4.0)
Answer» B. (1.0, 1.0)
4.

55+2/2)

A. 43
B. 44
C. 22
D. 23
Answer» C. 22
5.

Which of the following operators has its associativity from right to left?

A. +
B. //
C. %
D. **
Answer» E.
6.

+ 3 % 5

A. 4
B. 7
C. 2
Answer» C. 2
7.

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

A. true
B. false
Answer» B. false
8.

What does 3 ^ 4 evaluate to?

A. 81
B. 12
C. 0.75
D. 7
Answer» E.
9.

What is the result of round(0.5) – round(-0.5)?

A. 1.0
B. 2.0
C. 0.0
D. value depends on python version
Answer» E.
10.

What is the result of cmp(3, 1)?

A. 1
B. 0
C. true
D. false
Answer» B. 0
11.

What does ~4 evaluate to?

A. -5
B. -4
C. -3
D. +3
Answer» B. -4
12.

What is the type of inf?

A. boolean
B. integer
C. float
D. complex
Answer» D. complex
13.

Which of the following results in a SyntaxError?

A. ‘”once upon a time…”, she said.’
B. “he said, ‘yes!\”
C. ‘3\\’
D. ”’that’s okay”’
Answer» D. ”’that’s okay”’
14.

What is the return value of trunc()?

A. int
B. bool
C. float
D. none
Answer» B. bool
15.

>>>average = (grade1 + grade2) / 2

A. 85.0
B. 85.1
C. 95.0
D. 95.1
Answer» B. 85.1
16.

Which of the following is not a complex number?

A. k = 2 + 3j
B. k = complex(2, 3)
C. k = 2 + 3l
D. k = 2 + 3j
Answer» D. k = 2 + 3j
17.

What is the output of print 0.1 + 0.2 == 0.3?

A. true
B. false
C. machine dependent
D. error
Answer» C. machine dependent
18.

In order to store values in terms of key and value we use what core data type.

A. list
B. tuple
C. class
D. dictionary
Answer» E.
19.

>>>example("hello")

A. indentation error
B. cannot perform mathematical operation on strings
C. hello2
D. hello2hello2
Answer» B. cannot perform mathematical operation on strings
20.

, 23, 'hello', 1]

A. list
B. dictionary
C. array
D. tuple
Answer» B. dictionary
21.

>>>x = 13 ? 2

A. x = 13 // 2
B. x = int(13 / 2)
C. x = 13 % 2
D. all of the mentioned
Answer» E.
22.

What is the return type of function id?

A. int
B. float
C. bool
D. dict
Answer» B. float
23.

Which of the following will run without errors?

A. round(45.8)
B. round(6352.898,2,5)
C. round()
D. round(7463.123,2,1)
Answer» B. round(6352.898,2,5)
24.

3 DATA TYPES

A. he
B. lo
C. olleh
D. hello
Answer» B. lo
25.

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
Answer» E.
26.

Which one of the following has the highest precedence in the expression?

A. exponential
B. addition
C. multiplication
D. parentheses
Answer» E.
27.

The expression Int(x) implies that the variable x is converted to integer.

A. true
B. false
Answer» B. false
28.

Which one of the following has the same precedence level?

A. addition and subtraction
B. multiplication, division and addition
C. multiplication, division, addition and subtraction
D. addition and multiplication
Answer» B. multiplication, division and addition
29.

What is the output of this expression, 3*1**3?

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

Operators with the same precedence are evaluated in which manner?

A. left to right
B. right to left
C. can’t say
D. none of the mentioned
Answer» B. right to left
31.

Which one of these is floor division?

A. /
B. //
C. %
D. none of the mentioned
Answer» C. %
32.

Mathematical operations can be performed on a string.

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

What is the answer to this expression, 22 % 3 is?

A. 7
B. 1
C. 5
Answer» C. 5
34.

Which of the following is an invalid 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
Answer» C. a,b,c = 1000, 2000, 3000
35.

All keywords in Python are in

A. lower case
B. upper case
C. capitalized
D. none of the mentioned
Answer» E.
36.

Which of the following is not a keyword?

A. eval
B. assert
C. nonlocal
D. pass
Answer» B. assert
37.

Why are local variable names beginning with an underscore discouraged?

A. they are used to indicate a private variables of a class
B. they confuse the interpreter
C. they are used to indicate global variables
D. they slow down execution
Answer» B. they confuse the interpreter
38.

Which of the following is an invalid variable?

A. my_string_1
B. 1st_string
C. foo
D. _
Answer» C. foo
39.

Which of the following is invalid?

A. _a = 1
B.     a = 1
C.     str     = 1
D. none of the mentioned
Answer» E.
40.

What is the maximum possible length of an identifier?

A. 31 characters
B. 63 characters
C. 79 characters
D. none of the mentioned
Answer» E.
41.

Is Python case sensitive when dealing with identifiers?

A. yes
B. no
C. machine dependent
D. none of the mentioned
Answer» B. no
42.

A symbol used for grouping.

A. ()
B. {}
C. []
D. ” ”
Answer» B. {}
43.

Another notation for exponentiation.

A. *
B. **
C. ***
D. *^
Answer» C. ***
44.

                         begins with lower case letters.

A. keywords
B. variables
C. tokens
D. functions
Answer» C. tokens
45.

                           are identified by their addresses, we give them names (field names / variable names) using words.

A. memory variables
B. memory locations
C. memory addresses
D. data variables
Answer» C. memory addresses
46.

A statement used to close the IF block.

A. else
B. elseif
C. end
D. endif
Answer» E.
47.

The statement that tells the computer to get a value from an input device and store it in a memory location.

A. read
B. write
C. read
D. write
Answer» D. write
48.

                             is used to show hierarchy in a pseudo code.

A. indentation
B. curly braces
C. round brackets
D. semicolon
Answer» B. curly braces
49.

Capitalize initial keyword – This is a rule while writing a pseudo code.

A. true
B. false
Answer» B. false
50.

The following symbol denotes:

A. module
B. terminal
C. process
D. i/o operation
Answer» B. terminal