Python OOPs


Python SQLite


Examples


Others


Python MCQ (Mulitple Choice Questions and Answers)


  1. Who developed Python Programming Language?

    1. Wick van Rossum

    2. Rasmus Lerdorf

    3. Guido van Rossum

    4. Niene Stom

  2. Which type of Programming does Python support?

    1. object-oriented programming

    2. structured programming

    3. functional programming

    4. all of the above

  3. Which of the following is the correct extension of the Python file?

    1. .python

    2. .pl

    3. .py

    4. .p

  4. All keywords in Python are in

    1. Capitalized

    2. Lower Case

    3. Upper Case

    4. None of the above

  5. Which keyword is used for function in Python language?

    1. function

    2. def

    3. fun

    4. define

  6. Which type of Programming does Python support?

    1. object-oriented programming

    2. structured programming

    3. functional programming

    4. all of the above

  7. Is Python case sensitive when dealing with identifiers?

    1. No

    2. Yes

  8. Which of the following is used to define a block of code in Python language?

    1. Indentation

    2. Key

    3. Brackets

    4. All of the above

  9. Which of the following character is used to give single-line comments in Python?

    1. //

    2. #

    3. !

    4. /*

  10. Which of the following functions is a built-in function in python?

    1. factorial()

    2. print()

    3. seed()

    4. sqrt()

  11. Which of the following would NOT work as a variable name?

    1. a

    2. len

    3. length

    4. x

  12. In which year was the Python language first released?

    1. 1995

    2. 1972

    3. 1981

    4. 1991

  13. Which one of the following is not a python's predefined data type?

    1. List

    2. Dictionary

    3. Tuple

    4. Class

  14. Which of the following has more precedence?

    1. +

    2. ()

    3. /

    4. -

  15. What arithmetic operators cannot be used with strings in Python?

    1. *

    2. -

    3. +

    4. All of the above

  16. In which language is Python written?

    1. Java

    2. PHP

    3. C

    4. All of the above

  17. How to convert the lowercase letters in the string to uppercase in Python?

    1. uppercase()

    2. toUpper()

    3. capitalize()

    4. upper()

  18. How to convert the uppercase letters in the string to lowercase in Python??

    1. lowercase()

    2. capilaize()

    3. lower()

    4. toLower()

  19. Which of the following statements is used to create an empty set in Python?

    1. ( )

    2. [ ]

    3. { }

    4. set()

  20. What are the two main types of functions in Python?

    1. System function

    2. Custom function

    3. User function

    4. Built-in function & User defined function

  21. Which of the following data types is not supported in python ?

    1. String

    2. Slice

    3. Numbers

    4. List

  22. Do we need to compile a program before execution in Python?

    1. No

    2. Yes

  23. Are nested if-else are allowed in Python?

    1. Yes

    2. No

  24. What is the maximum possible length of an identifier in python?

    1. 18

    2. 41

    3. 62

    4. 79

  25. In Python, a variable must be declared before it is assigned a value?

    1. True

    2. False

  26. How can we create an empty list in python?

    1. list=()

    2. list.null

    3. list=[]

    4. null.list

  27. What is type casting in python?

    1. Declaration of data type

    2. Destroy data type

    3. Change data type property

    4. None of the above

  28. In python programming, pass is a null statement.

    1. True

    2. False

  29. In order to store values in terms of key and value we use that core data type in python?

    1. List

    2. Class

    3. Dictionary

    4. Tupple

  30. Operators with the same precedence are evaluated in which manner?

    1. Left to Right

    2. Right to Left

    3. Can’t say

    4. None of the above