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.
This CBSE Class 11 Computer Science practice quiz has 20 multiple-choice questions on Getting Started with Python, and 20 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.
Start quiz: 20 questions, freeSample questions
What is Python?
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?
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))`?
Show answer
Answer: A. <class 'int'>
`type()` returns the data type of a variable or value.
What is an infinite loop?
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?
Show answer
Answer: B. A tuple is immutable, a list is mutable
Tuples are immutable (cannot be changed after creation), while lists are mutable.
More questions in this quiz
Answers and explanations are in the full quiz.
- Which of the following is a valid Python variable name?
- What is the output of the following Python code: `print('Hello, world!')`?
- What data type is the result of `10 / 3` in Python?
- What is the purpose of the `input()` function in Python?
- What will be the value of x after executing `x = 5; x += 2`?
- What is the difference between `=` and `==` in Python?
- How do you convert a string to an integer in Python?
- What is the boolean result of `10 > 5 and 5 < 10`?
- What does the `elif` keyword do in Python?
- Explain the difference between a `while` loop and a `for` loop in Python.
- What will be the output of this code: `numbers = [1, 2, 3]; print(numbers[1])`?
- How do you add an element to the end of a list in Python?
- Explain the concept of slicing in Python lists.
- How would you create a dictionary in Python containing key-value pairs?
- What is the difference between a shallow copy and a deep copy of a list in Python?
More quizzes
Browse all Programming and Computational Thinking quizzes