Any2Quiz
Quizzes / CBSE / Class 9 / ICT / Programming Basics

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, free

Sample questions

  1. 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'.

  2. 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.

  3. 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.

  4. 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].

  5. 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.

Take the full quiz

More questions in this quiz

Answers and explanations are in the full quiz.

  1. Which symbol is used for comments in Python?
  2. What will be the output of the code: print(2 + 3)?
  3. What will be the output of: print(type(5))?
  4. If x = [1, 2, 3], what does x.append(4) do?
  5. What will be the output of: print(3 * 'A')?
  6. Which function is used to get the length of a list in Python?
  7. What does the 'break' statement do in a loop?
  8. What will be the output of: print('Hello' + ' World')?
  9. What does the function 'range(5)' return?
  10. What is the output of the following code: for i in range(3): print(i)?
  11. What does the 'continue' statement do in a loop?
  12. What will be the output of the following code: def func(): return 42; print(func())?
  13. What is the correct way to create a variable with the numeric value 5?
  14. How do you insert comments in Python code?

More quizzes

Browse all Programming Basics quizzes

More to play

Daily ChallengeA new quiz every day. Keep your streak.HangmanGuess the word, letter by letter.Story QuestLearn through short interactive stories.All quizzesCBSE, ICSE, competitive exams and more.