Python Basics Quiz - CBSE Class 9 ICT
Free practice quiz: Python Basics (CBSE Class 9 ICT). 19 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 19 questions freeSample questions
What is a variable in Python?
- A reserved memory location to store values
- A function name
- A Python keyword
- A data type
Show answer
Answer: A. A reserved memory location to store values
Variables in Python are used to store values. They act as reserved memory locations.
Which of the following is used to create a comment in Python?
- // This is a comment
- /* This is a comment */
- # This is a comment
- <!-- This is a comment -->
Show answer
Answer: C. # This is a comment
In Python, comments start with a # symbol.
Which of the following correctly imports the math module in Python?
- import math
- #import math
- $import math$
- <import math>
Show answer
Answer: A. import math
To use the math module in Python, you import it using the 'import' keyword.
Which of the following methods is used to add an item at the end of the list in Python?
- insert()
- append()
- extend()
- add()
Show answer
Answer: B. append()
The append() method adds an item to the end of a list.
Which keyword is used to declare a variable globally when inside a function?
- global
- var
- let
- public
Show answer
Answer: A. global
The 'global' keyword is used to declare variables globally, allowing their usage both inside and outside functions.