MCQOPTIONS
Saved Bookmarks
This section includes 1007 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 951. |
To find the decimal value of 1111, that is 15, we can use the function: |
| A. | int(1111,10) |
| B. | int(‘1111’,10) |
| C. | int(1111,2) |
| D. | int(‘1111’,2) |
| Answer» E. | |
| 952. |
What is the result of the expression: int(1011)? |
| A. | 1011 |
| B. | 11 |
| C. | 13 |
| D. | 1101 |
| Answer» B. 11 | |
| 953. |
What is the value of x if: x>>2=2 |
| A. | 8 |
| B. | 4 |
| C. | 2 |
| D. | 1 |
| Answer» B. 4 | |
| 954. |
The output of the expression is: bin(29) |
| A. | ‘0b10111’ |
| B. | ‘0b11101’ |
| C. | 0b11111’ |
| D. | ‘0b11011’ |
| Answer» C. 0b11111’ | |
| 955. |
What is the result of the snippet of code shown below if x=1? x |
| A. | 8 |
| B. | 1 |
| C. | 2 |
| D. | 4 |
| Answer» E. | |
| 956. |
What is the value of the expression: 4+2**5//10 |
| A. | 3 |
| B. | 7 |
| C. | 77 |
| D. | 0 |
| Answer» C. 77 | |
| 957. |
Which of the following expressions results in an error? |
| A. | float(‘10’) |
| B. | int(‘10’) |
| C. | float(’10.8’) |
| D. | int(’10.8’) |
| Answer» E. | |
| 958. |
Which of the following expressions is an example of type conversion? |
| A. | 4.0 + float(3) |
| B. | 5.3 + 6.3 |
| C. | 5.0 + 3 |
| D. | 3 + 7 |
| Answer» B. 5.3 + 6.3 | |
| 959. |
What is the value of the expression: float(4+int(2.39)%2) |
| A. | 5.0 |
| B. | 5 |
| C. | 4.0 |
| D. | 4 |
| Answer» D. 4 | |
| 960. |
Which among the following list of operators has the highest precedence? +, -, **, %, /, , | |
| A. | ) <<, >> |
| B. | ) ** |
| C. | | |
| D. | % |
| Answer» C. | | |
| 961. |
What is the value of the following expression: 24//6%3, 24//4//2 |
| A. | (1,3) |
| B. | (0,3) |
| C. | (1,0) |
| D. | (3,1) |
| Answer» B. (0,3) | |
| 962. |
Which of the following expressions involves coercion when evaluated in Python? |
| A. | 4.7 – 1.5 |
| B. | 7.9 * 6.3 |
| C. | 1.7 % 2 |
| D. | 3.4 + 4.6 |
| Answer» D. 3.4 + 4.6 | |
| 963. |
Consider the expression given below. The value of X is: X = 2+9*((3*12)-8)/10 |
| A. | 30.0 |
| B. | 30.8 |
| C. | 28.4 |
| D. | 27.2 |
| Answer» E. | |
| 964. |
What is the output of the following expression: print(4.00/(2.0+2.0)) |
| A. | Error |
| B. | 1.0 |
| C. | 1.00 |
| D. | 1 |
| Answer» C. 1.00 | |
| 965. |
What is the value of the following expression: float(22//3+3/3) |
| A. | 8 |
| B. | 8.0 |
| C. | 8.3 |
| D. | 8.33 |
| Answer» C. 8.3 | |
| 966. |
What is the value of the following expression: 8/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) | |
| 967. |
What are the values of the following expressions: 2**(3**2) (2**3)**2 2**3**2 |
| A. | 64, 512, 64 |
| B. | 64, 64, 64 |
| C. | 512, 512, 512 |
| D. | 512, 64, 512 |
| Answer» E. | |
| 968. |
Which of the following is the truncation division operator? |
| A. | / |
| B. | % |
| C. | // |
| D. | | |
| Answer» D. | | |
| 969. |
What is the value of the following expression? 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) | |
| 970. |
What is the value of x if: x = int(43.55+2/2) |
| A. | 43 |
| B. | 44 |
| C. | 22 |
| D. | 23 |
| Answer» C. 22 | |
| 971. |
Which of the following operators has its associativity from right to left? |
| A. | + |
| B. | // |
| C. | % |
| D. | ** |
| Answer» E. | |
| 972. |
Evaluate the expression given below if A= 16 and B = 15. A % B // A |
| A. | 0.0 |
| B. | 0 |
| C. | 1.0 |
| D. | 1 |
| Answer» C. 1.0 | |
| 973. |
The value of the expression: 4 + 3 % 5 |
| A. | 4 |
| B. | 7 |
| C. | 2 |
| D. | 0 |
| Answer» C. 2 | |
| 974. |
What does 3 ^ 4 evaluate to? |
| A. | 81 |
| B. | 12 |
| C. | 0.75 |
| D. | 7 |
| Answer» E. | |
| 975. |
What is the result of round(0.5) – round(-0.5)? |
| A. | 1.0 |
| B. | 2.0 |
| C. | 0.0 |
| D. | None of the mentioned |
| Answer» C. 0.0 | |
| 976. |
What is the result of cmp(3, 1)? |
| A. | 1 |
| B. | 0 |
| C. | True |
| D. | False |
| Answer» B. 0 | |
| 977. |
Which of the following is incorrect? |
| A. | x = 0b101 |
| B. | x = 0x4f5 |
| C. | x = 19023 |
| D. | x = 03964 |
| Answer» E. | |
| 978. |
What does ~~~~~~5 evaluate to? |
| A. | +5 |
| B. | -11 |
| C. | +11 |
| D. | -5 |
| Answer» B. -11 | |
| 979. |
What does ~4 evaluate to? |
| A. | -5 |
| B. | -4 |
| C. | -3 |
| D. | +3 |
| Answer» B. -4 | |
| 980. |
What is the type of inf? |
| A. | Boolean |
| B. | Integer |
| C. | Float |
| D. | Complex |
| Answer» D. Complex | |
| 981. |
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 | |
| 982. |
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 | |
| 983. |
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”’ | |
| 984. |
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. | |
| 985. |
What data type is the object below ? L = [1, 23, ‘hello’, 1]. |
| A. | list |
| B. | dictionary |
| C. | array |
| D. | tuple |
| Answer» B. dictionary | |
| 986. |
What error occurs when you execute? apple = mango |
| A. | SyntaxError |
| B. | NameError |
| C. | ValueError |
| D. | TypeError |
| Answer» C. ValueError | |
| 987. |
What is the return type of function id ? |
| A. | int |
| B. | float |
| C. | bool |
| D. | dict |
| Answer» B. float | |
| 988. |
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) | |
| 989. |
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. | |
| 990. |
Which of these in not a core data type? |
| A. | Lists |
| B. | Dictionary |
| C. | Tuples |
| D. | Class |
| Answer» E. | |
| 991. |
Which one of the following have the highest precedence in the expression? |
| A. | Exponential |
| B. | Addition |
| C. | Multiplication |
| D. | Parentheses |
| Answer» E. | |
| 992. |
Which one of the following have the same precedence? |
| A. | Addition and Subtraction |
| B. | Multiplication and Division |
| C. | Both Addition and Subtraction AND Multiplication and Division |
| D. | None of the mentioned |
| Answer» B. Multiplication and Division | |
| 993. |
What is the output of this expression, 3*1**3? |
| A. | 27 |
| B. | 9 |
| C. | 3 |
| D. | 1 |
| Answer» D. 1 | |
| 994. |
What is answer of this expression, 22 % 3 is? |
| A. | 7 |
| B. | 1 |
| C. | 0 |
| D. | 5 |
| Answer» C. 0 | |
| 995. |
What is the order of precedence in python? i) Parentheses ii) Exponential iii) Multiplication iv) Division v) Addition vi) Subtraction |
| A. | i,ii,iii,iv,v,vi |
| B. | ii,i,iii,iv,v,vi |
| C. | ii,i,iv,iii,v,vi |
| D. | i,ii,iii,iv,vi,v |
| Answer» B. ii,i,iii,iv,v,vi | |
| 996. |
Which one of these is floor division? |
| A. | / |
| B. | // |
| C. | % |
| D. | None of the mentioned |
| Answer» C. % | |
| 997. |
Which is the correct operator for power(xy)? |
| A. | X^y |
| B. | X**y |
| C. | X^^y |
| D. | None of the mentioned |
| Answer» C. X^^y | |
| 998. |
Which of the following cannot be a variable? |
| A. | __init__ |
| B. | in |
| C. | it |
| D. | on |
| Answer» C. it | |
| 999. |
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 | |
| 1000. |
Which of the following is true for variable names in Python? |
| A. | unlimited length |
| B. | all private members must have leading and trailing underscores |
| C. | underscore and ampersand are the only two special characters allowed |
| D. | none of the mentioned |
| Answer» B. all private members must have leading and trailing underscores | |