Python MCQ Questions on Fundamental

Python MCQ Questions on Fundamental Here provide Python Multiple Choice Questions and Answer. you can learn and practice questions.

Python MCQ Questions on Fundamental

1. Who developed Python Programming Language?

a) Wick van Rossum
b) Rasmus Lerdorf
c) Guido van Rossum
d) Niene Stom

Answer : c
Explanation : Python language is designed by a Dutch programmer Guido van Rossum in the Netherlands.

2. Which type of Programming does Python support?

a) object-oriented programming
b) structured programming
c) functional programming
d) all of the mentioned

Answer : d
Explanation : Python is an interpreted programming language, which supports object-oriented, structured, and functional programming.

3. Is Python case sensitive when dealing with identifiers?

a) no
b) yes
c) machine dependent
d) none of the mentioned

Answer : b
Explanation : Case is always significant while dealing with identifiers in python.

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

a) .python
b) .pl
c) .py
d) .p

Answer : c
Explanation : ‘.py’ is the correct extension of the Python file. Python programs can be written in any text editor. To save these programs we need to save in files with file extension ‘.py’.

5. Is Python code compiled or interpreted?

a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

Answer: a
Explanation : Many languages have been implemented using both compilers and interpreters, including C, Pascal, and Python.

6. All keywords in Python are in ________

a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

Answer: d
Explanation : True, False and None are capitalized while the others are in lower case.

7. What will be the value of the following Python expression?

4 + 3 % 5

a) 7
b) 2
c) 4
d) 1

Answer : a
Explanation : The order of precedence is: %, +. Hence the expression above, on simplification results in 4 + 3 = 7. Hence the result is 7.

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

a) Indentation
b) Key
c) Brackets
d) All of the mentioned

Answer : a
Explanation : In Python, to define a block of code we use indentation. Indentation refers to whitespaces at the beginning of the line.

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

a) Function
b) def
c) Fun
d) Define

Answer : b
Explanation : The def keyword is used to create, (or define) a function in python.

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

a) //
b) #
c) !
d) /*

Answer : b
Explanation : To write single-line comments in Python use the Hash character (#) at the beginning of the line. It is also called number sign or pound sign. To write multi-line comments, close the text between triple quotes.
Example : “”” comment
text “””

Be the first to comment

Leave a Reply

Your email address will not be published.


*