PYTHON Syntax MCQ
Python MCQ(1) Which of the following is valid file extension of python programming script file ?
A) .python
B) .pythoncode
C) .py
D) .pie
Explanation
.py is a valid python script file extension.
(2) In python programmingwhich of the following function is used to check the data type of variable?
A) datatype()
B) type()
C) typeof()
D) dtype()
Explanation
We can use type(variable_name) function to get/know the data type of the variable/identifier.
(3) In python programming type of Lvalue always depend on _________
A) Data type
B) type of Rvalue
C) Type specified
D) Already defined
Explanation
In python programming Lvalue types is defined according to the contents of Rvalue.
(4) Which of the following has vital role in python code formatting?
A) Delimeters
B) Indents
C) Parentheses
D) Space
Explanation
Indents play an important and vital role in entire formatting and code placements.
(5) Which of the following is used for nesting code in python programming ?
A) Delimiters
B) Parentheses
C) Indents
D) Squaare Brackets
Explanation
According to python syntax except of delimiters indents are used for nesting block of code.
(6) Which of the following is true about python syntax ?
A) Strongly Typed
B) Loosly Typed
C) Rigid Typed
D) Highly Typed
Explanation
Python is a loosely typed programming language. It means that there is no need to specify type/data type of any variable before storing data in it.
(7) Python programming has much similar features such like other famous high level languages such as.
A) C
B) C++
C) Java
D) All of these
Explanation
The basic syntax paradigms of python is much similar to C,C++, Pearl and Java. Such as format string and implementation of control structures.
(8) Which of the following is not suitable about python programming syntax ?
A) Easy
B) Straightforward
C) Difficult
D) Understandable
Explanation
Difficult is not a suitable word for python syntax, because it's syntax is much straightforward and simple to understand.