Python MCQ Quiz Hub

MCQ Introduction to Python Section 1

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

1. Which of the following is not in Python Character Set.




2. Which of the following is not the mode of interacting with python?




3. What will be the data type of the following variable?




4. Write the output of the following: print(range(0,8,2))




5. Which of the following is not correct about python?




6. Which of the following is not correct about python?




7. Smallest element of of python coding is called ________




8. Which of the following is not a token?




9. Write the output of the following code: x=2 x=5 x=x+x print(x)




10. Write the output of the following code : x=2 y=3 x+y+5 print(x+y)




11. Which of the following symbol is used to write comment?




12. Each statement in python is terminated by ___




13. Write the output of the following: print(‘Hello, world!’);print(“H”)




14. ___ spaces should be left for indentation.




15. What type of error is returned by the following statement? def abc(a): print(a)




16. Which keyword is used to define a function in python?




17. Write the output of the following: a=8 def abc(a): print(a) abc(7)




18. Statement below “function definition” begin with spaces called ____




19. Which of the following is invalid variable name? a.




20. Write the output of the following. def abc(): print("abc")




21. Which statement will display square of number (n)




22. What type of error is returned by the following statement? print(eval(13))




23. Which statement is adding remainder of 8 divided by 3 to the product of 5 and 6?




24. Identify the invalid identifier. b. c. d.




25. Which keyboard key is used to run python programs?




26. Which method is used to find the memory location of variable?




27. ________________ method is used to find the data type of a variable.




28. ____________ escape sequence is used for horizontal tab. a. b. c. T d. No




29. An escape sequence is represented by __________ slash followed by one or two characters.




30. Write the output of the following code : >>> x = 4 - 7j >>> print(x.imag, x.real)




31. Write the output of the following code : >>> a=9 >>> x=str(a) >>> b=5 >>> y=str(b) >>> x+y




32. Write the output of the following code : >>> 7+2//1**2 > 5+2**2//3 a. b.




33. Write the output of the following code : >>> s = None >>> s




34. Which of the following assignment will return error?




35. Which of the following is wrong in reference to naming of variable?




36. Which of the following is invalid identifier?




37. Identifier name can be of maximum ____________ character




38. Which of the following can not be used as an identifier?




39. Which of the following statement is calculating x raise to power n?




40. Write the output of the following. m, n, p = 1, 2, 3 print(m, n, p)




41. Which of the following is valid operator?




42. Output of print(7 % 21) is ____




43. Operators of same precedence are executed from _____