Getting Started with Python Quiz - CBSE Class 11 Computer Science
Free practice quiz: Getting Started with Python (CBSE Class 11 Computer Science). 20 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 20 questions freeSample questions
What is Python?
- A programming language
- An operating system
- A type of hardware
- A software application
Show answer
Answer: A. A programming language
Python is a high-level, general-purpose programming language.
How do you comment out a single line of code in Python?
- // This is a comment
- # This is a comment
- /* This is a comment */
- ' This is a comment'
Show answer
Answer: B. # This is a comment
In Python, a single line comment is denoted by #.
What is the output of `print(type(10))`?
- <class 'int'>
- <class 'str'>
- <class 'float'>
- <class 'bool'>
Show answer
Answer: A. <class 'int'>
`type()` returns the data type of a variable or value.
What is an infinite loop?
- A loop that never ends
- A loop that runs only once
- A loop that runs for a specific number of times
- A loop that is interrupted by an error
Show answer
Answer: A. A loop that never ends
An infinite loop lacks a condition to terminate it.
What is a tuple in Python and how does it differ from a list?
- A tuple is mutable, a list is immutable
- A tuple is immutable, a list is mutable
- Both are same
- Tuples are faster, lists are slower
Show answer
Answer: B. A tuple is immutable, a list is mutable
Tuples are immutable (cannot be changed after creation), while lists are mutable.