Python MCQ Quiz Hub

Python Mcq Set 1

Choose a topic to test your knowledge and improve your Python skills

Is Python case sensitive when dealing with identifiers?





✅ Correct Answer: 1

What is the maximum possible length of an identifier?





✅ Correct Answer: 4

Which of the following is invalid?





✅ Correct Answer: 4

Which of the following is an invalid variable?





✅ Correct Answer: 2

Why are local variable names beginning with an underscore discouraged?





✅ Correct Answer: 1

Which of the following is not a keyword?





✅ Correct Answer: 1

Which is the correct operator for power(xy)?





✅ Correct Answer: 2

Which one of these is floor division?





✅ Correct Answer: 2

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





✅ Correct Answer: 2

Operators with the same precedence are evaluated in which manner?





✅ Correct Answer: 1

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





✅ Correct Answer: 3

Which of these in not a core data type?





✅ Correct Answer: 4

Given a function that does not return any value, What value is thrown by default when executed in shell.





✅ Correct Answer: 4

Which of the following will run without errors?





✅ Correct Answer: 1

What is the return type of function id?





✅ Correct Answer: 1

In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed. >>>x = 13 ? 2 objective is to make sure x has a integer value, select all that apply (python 3.xx)





✅ Correct Answer: 4

What error occurs when you execute the following Python code snippet? apple = mango





✅ Correct Answer: 2

What data type is the object below? L = [1, 23, 'hello', 1]





✅ Correct Answer: 1

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





✅ Correct Answer: 4

Which of the following results in a SyntaxError?





✅ Correct Answer: 3

Select all options that print. hello-how-are-you





✅ Correct Answer: 3

What is the return value of trunc()?





✅ Correct Answer: 1

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





✅ Correct Answer: 2

Which of the following is not a complex number?





✅ Correct Answer: 3

What is the type of inf?





✅ Correct Answer: 3

What does ~4 evaluate to?





✅ Correct Answer: 1

What does ~~~~~~5 evaluate to?





✅ Correct Answer: 1

Which of the following is incorrect?





✅ Correct Answer: 4

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





✅ Correct Answer: 1

Which of the following is incorrect?





✅ Correct Answer: 4

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





✅ Correct Answer: 4

What does 3 ^ 4 evaluate to?





✅ Correct Answer: 4

What will be the value of the following Python expression? 4 + 3 % 5





✅ Correct Answer: 2

Evaluate the expression given below if A = 16 and B = 15. A % B // A





✅ Correct Answer: 2

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





✅ Correct Answer: 4

What will be the value of x in the following Python expression? x = int(43.55+2/2)





✅ Correct Answer: 2

What is the value of the following expression? 2+4.00, 2**4.0





✅ Correct Answer: 1

Which of the following is the truncation division operator?





✅ Correct Answer: 3

What are the values of the following Python expressions? 2**(3**2) (2**3)**2 2**3**2





✅ Correct Answer: 4

What is the value of the following expression? 8/4/2, 8/(4/2)





✅ Correct Answer: 1

What is the value of the following expression? float(22//3+3/3)





✅ Correct Answer: 2

What will be the output of the following Python expression? print(4.00/(2.0+2.0))





✅ Correct Answer: 2

What will be the value of X in the following Python expression? X = 2+9*((3*12)-8)/10





✅ Correct Answer: 4

Which of the following expressions involves coercion when evaluated in Python?





✅ Correct Answer: 3

What will be the output of the following Python expression? 24//6%3, 24//4//2





✅ Correct Answer: 1

Which among the following list of operators has the highest precedence? +, -, **, %, /, <<, >>, |





✅ Correct Answer: 2

What will be the value of the following Python expression? float(4+int(2.39)%2)





✅ Correct Answer: 3

Which of the following expressions is an example of type conversion?





✅ Correct Answer: 1

Which of the following expressions results in an error?





✅ Correct Answer: 4

What will be the value of the following Python expression? 4+2**5//10





✅ Correct Answer: 2