Simple Python Programs Quiz - CBSE Class 9 ICT
Free practice quiz: Simple Python Programs (CBSE Class 9 ICT). 19 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
This CBSE Class 9 ICT practice quiz has 19 multiple-choice questions on Simple Python Programs, and 19 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: 19 questions, freeSample questions
What is the correct output of the following code: print('Hello World')?
Show answer
Answer: B. Hello World
The print function outputs the string as it is provided within the quotes. Therefore, the correct output is 'Hello World'.
Which of the following data types is mutable in Python?
Show answer
Answer: C. Set
Among the given data types, a set is mutable, meaning its contents can be changed after it is created.
What is the result of the expression: 10 // 3?
Show answer
Answer: A. 3
The // operator in Python performs floor division, which discards the fractional part and returns the largest integer less than or equal to the division result.
What is the result of the expression: [1, 2, 3] * 2?
Show answer
Answer: A. [1, 2, 3, 1, 2, 3]
The * operator when used with lists repeats the list. Thus, [1, 2, 3] * 2 gives [1, 2, 3, 1, 2, 3].
Which of the following constructs can be used to create a function in Python?
Show answer
Answer: B. def
In Python, the 'def' keyword is used to define a function.
More questions in this quiz
Answers and explanations are in the full quiz.
- Which symbol is used for comments in Python?
- What will be the output of the code: print(2 + 3)?
- What will be the output of: print(type(5))?
- If x = [1, 2, 3], what does x.append(4) do?
- What will be the output of: print(3 * 'A')?
- Which function is used to get the length of a list in Python?
- What does the 'break' statement do in a loop?
- What will be the output of: print('Hello' + ' World')?
- What does the function 'range(5)' return?
- What is the output of the following code: for i in range(3): print(i)?
- What does the 'continue' statement do in a loop?
- What will be the output of the following code: def func(): return 42; print(func())?
- What is the correct way to create a variable with the numeric value 5?
- How do you insert comments in Python code?
More quizzes
Browse all Programming Basics quizzes