Home Subjects Python Programming Basics & Syntax

Python Programming
Basics & Syntax

Python fundamentals to advanced for interviews

33 Q 2 Topics Take Mock Test
Advertisement
Difficulty: All Easy Medium Hard 31–33 of 33
Topics in Python Programming
All Basics & Syntax 100 Data Types & Lists 19
Q.31 Easy Basics & Syntax
What will be the output of: print(type(5.0))?
A
B
C
D
Correct Answer:  B.
EXPLANATION

5.0 is a floating-point number in Python. The type() function returns <class 'float'> for decimal numbers.

Test
Q.32 Easy Basics & Syntax
Which of the following is NOT a valid Python identifier?
A _variable
B variable2
C 2variable
D var_name
Correct Answer:  C. 2variable
EXPLANATION

Python identifiers cannot start with a digit. They must begin with a letter or underscore.

Test
Q.33 Easy Basics & Syntax
What is the correct way to create a variable in Python?
A variable_name = value
B $variable_name = value
C variable-name = value
D variable name = value
Correct Answer:  A. variable_name = value
EXPLANATION

Python variables are created using the assignment operator (=) with valid identifiers containing letters, digits, and underscores.

Test
IGET
IGET AI
Online · Exam prep assistant
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips