Govt. Exams
Entrance Exams
Advertisement
Topics in Python Programming
What will be the output of: print(type(5.0))?
Correct Answer:
B.
EXPLANATION
5.0 is a floating-point number in Python. The type() function returns <class 'float'> for decimal numbers.
Which of the following is NOT a valid Python identifier?
Correct Answer:
C. 2variable
EXPLANATION
Python identifiers cannot start with a digit. They must begin with a letter or underscore.
What is the correct way to create a variable in Python?
Correct Answer:
A. variable_name = value
EXPLANATION
Python variables are created using the assignment operator (=) with valid identifiers containing letters, digits, and underscores.