Python MCQ Quiz Hub

MCQ Introduction to Python Section 2

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

1. Output of print(2 * 3 ** 2) is




2. Write the output of the following: x = int(7) + int (‘9’) print(x)




3. Out of addition(+) and Subtraction (-) operator, which has more precedence?




4. Which of the following statement will return error when x = 7 ?




5. Which of the following store data in pair?




6. What is the return type of function id( )?




7. An ordered set of instructions to be executed by a computer to carry out a specific task is called ___




8. Computers understand the language of 0s and 1s which is called _______




9. A program written in a high-level language is called _________ code




10. Python uses ____ to convert its instructions into machine language.




11. Language translator convert ______________ code to _______________ code.




12. Which of the following is not the feature of python language?




13. In which of the following mode, the interpreter executes the statement and displays the result as soon as we press ‘Enter’ key?




14. By default, the Python scripts are saved with ____________ extension.




15. By default, the Python scripts are saved in ____




16. ________ are reserved words.




17. Which of the following is not correct for naming an identifier in Python?




18. Comments in python program are ________________ by interpreter




19. In Python single line comment starts with __




20. In Python multi line comment starts with _________




21. Which of the following is a sequence data type?




22. _________ is a set of valid characters that a language can recognize.




23. The smallest individual unit in a program is known as _




24. Which of the following is token in Python?




25. Which of the following is String literal?




26. Variables of data types like integers, float etc., hold __




27. Which of the following is invalid data type in python?




28. Multiline string in python can be created by enclosing text in ____




29. Which of the following is mapping data type in Python?




30. Variables whose values can be changed after they are created and assigned are called __




31. An _______________ is a symbol which is used to perform specific mathematical or logical operation on values.




32. Operators work on values called ___




33. Which operator returns remainder?




34. 86. Which of the following is an exponent operator?




35. Which of the following statement display “RAM” two times?




36. Write the output of the following: >>> 7 % 3 ** 3




37. Which of the following is not an integer literal?




38. Which escape sequence represent newline character?




39. Which of the following is number data type in python?




40. Which of the following is an invalid relational operator in Python?




41. print(3 != 4) will evaluates __




42. Which of the following is an assignment operator?




43. Statement x += y is equivalent to ______




44. Write the output of the following : >>> num1 = 7 >>> num2 = 3 >>> num1 //= num2 >>> num1




45. Write the output of the following : >>> a = 'India' >>> a *= 3 >>> a




46. Which of the following is invalid logical operator?




47. print(bool(3 and 6)) evaluates to __




48. print(bool(True and True or False)) evaluates to ___




49. 101. >>> bool(0) evaluates to _




50. __________ operators are used to check if a value is a member of the given sequence or not.