🔥 LIVE 👩‍🏫 Teachers: Host Live Tests  |  🎓 Students: Practice Class-wise Quizzes Go to Quiz Portal ➔

Computational Thinking and Programming Quiz 2

🐍 Computational Thinking & Programming Quiz 2 — Python Basics (Class 11 CS)

Practice 15 CBSE Class 11 Computer Science (Code 083) MCQs on the basics of Python programming — introduction to Python, features of Python, execution modes, the Python character set, tokens (keywords, identifiers, literals, operators, punctuators), variables, l-value & r-value, and comments.

Tap any question to reveal the answer with a clear explanation — great for quick revision before a class test or the board exam.

🐍 Python Basics▶️ Execution🔤 Character Set🧩 Tokens📦 Variables💬 Comments
Q1
🐍 Python Basics

Python is a:

  1. Compiler
  2. Interpreter
  3. High-level programming language
  4. Low-level programming language
Show Answer & Explanation

✅ Answer: (c) High-level programming language

Python is classified as a high-level programming language — its syntax reads close to English and it abstracts away hardware-level details. (Its code does get run through an interpreter, but “interpreter” describes how it’s executed, not what kind of language it is.)

Q2
🐍 Python Basics

Which of the following is a feature of Python?

  1. Strongly typed
  2. Compiled language
  3. Static typing
  4. Dynamically typed
Show Answer & Explanation

✅ Answer: (d) Dynamically typed

Python is dynamically typed — you don’t need to declare a variable’s data type; it’s decided automatically at runtime based on the value assigned. (Python is also strongly typed, but “dynamically typed” is the feature most commonly highlighted in the CBSE syllabus as distinguishing Python from languages like C++ or Java.)

Q3
▶️ Execution

How do you execute a “Hello World” program in Python?

  1. Save the program as a .txt file
  2. Use the print() function to display “Hello World”
  3. Use the input() function to get user input
  4. Use the main() function to run the program
Show Answer & Explanation

✅ Answer: (b) Use the print() function to display “Hello World”

The classic first Python program is simply print(“Hello World”) — the print() function outputs text to the console. Python doesn’t require a main() function like C/Java do.

Q4
▶️ Execution

What are the two execution modes in Python?

  1. Compile mode and run mode
  2. Debug mode and execute mode
  3. Interactive mode and script mode
  4. Static mode and dynamic mode
Show Answer & Explanation

✅ Answer: (c) Interactive mode and script mode

Python code can be run in interactive mode (typing statements one at a time at the >>> prompt and seeing immediate results) or script mode (writing a complete .py file and running it all at once).

Q5
🔤 Character Set

The Python character set is based on:

  1. ASCII
  2. Unicode
  3. UTF-8
  4. UTF-32
Show Answer & Explanation

✅ Answer: (b) Unicode

Python’s character set is based on Unicode — a much larger standard than ASCII that lets Python source code and strings represent virtually any character from any language in the world.

Q6
🧩 Tokens

Which of the following is a Python keyword?

  1. variable
  2. if
  3. function
  4. class
Show Answer & Explanation

✅ Answer: (b) if

if is a reserved Python keyword. Note: this question is slightly ambiguous in its original form — class is technically also a Python keyword (used to define a class), so both (b) and (d) are valid keywords. variable and function, however, are not keywords at all — Python uses def to define functions, and “variable” isn’t a reserved word.

Q7
🧩 Tokens

What is an identifier in Python?

  1. A value assigned to a variable
  2. A special character used in Python syntax
  3. A name used to identify a variable, function, or class
  4. A reserved word in the Python language
Show Answer & Explanation

✅ Answer: (c) A name used to identify a variable, function, or class

An identifier is simply the name you give to a variable, function, class, or other object — like marks or calculate_total. It’s how you refer to things in your code.

Q8
🧩 Tokens

Which of the following is a Python literal?

  1. + (plus)
  2. 3.14
  3. for
  4. print()
Show Answer & Explanation

✅ Answer: (b) 3.14

3.14 is a literal — a fixed value written directly into the code (here, a floating-point number). + is an operator, for is a keyword, and print() is a function call, not a literal value.

Q9
🧩 Tokens

What is the purpose of an operator in Python?

  1. To assign a value to a variable
  2. To declare a function
  3. To perform operations on data
  4. To display output on the console
Show Answer & Explanation

✅ Answer: (c) To perform operations on data

An operator (like +, -, ==, and) is a symbol used to perform operations on data — arithmetic, comparison, logical, and so on.

Q10
🧩 Tokens

What is a punctuator in Python?

  1. A symbol used for arithmetic operations
  2. A special character used in Python syntax
  3. A reserved word in the Python language
  4. A data type in Python
Show Answer & Explanation

✅ Answer: (b) A special character used in Python syntax

A punctuator is a special character that plays a structural role in Python’s syntax — symbols like :, ,, (, ), [, and ].

Q11
📦 Variables

What is the concept of l-value and r-value in Python?

  1. Left value and right value
  2. Local value and remote value
  3. Low value and high value
  4. Logical value and relational value
Show Answer & Explanation

✅ Answer: (a) Left value and right value

l-value stands for “left value” (the variable on the left side of an assignment, where a value is stored) and r-value stands for “right value” (the value or expression on the right side being assigned).

Q12
💬 Comments

How do you define a comment in Python?

  1. Using the // symbol
  2. Using the # symbol
  3. Using the /* */ symbols
  4. Using the <!– –> symbols
Show Answer & Explanation

✅ Answer: (b) Using the # symbol

Python uses the # symbol to mark a single-line comment — everything after it on that line is ignored by the interpreter. (// and /* */ are comment styles from C-family languages, not Python.)

Q13
📦 Variables

What is the purpose of variables in Python?

  1. To store and manipulate data
  2. To define functions
  3. To write comments
  4. To import modules
Show Answer & Explanation

✅ Answer: (a) To store and manipulate data

Variables exist to store and manipulate data while a program runs — holding values that can be read, changed, and used in calculations or logic.

Q14
📦 Variables

What is the use of an l-value in Python?

  1. To store the result of an expression
  2. To represent the left-hand side of an assignment
  3. To calculate mathematical operations
  4. To compare values in conditional statements
Show Answer & Explanation

✅ Answer: (b) To represent the left-hand side of an assignment

An l-value represents the left-hand side of an assignment — the variable that will receive and store the value produced by the right-hand side (the r-value).

Q15
💬 Comments

Which of the following is true about Python comments?

  1. They are executed as part of the program
  2. They provide explanations and improve code readability
  3. They are used for debugging purposes
  4. They are required to run a Python program
Show Answer & Explanation

✅ Answer: (b) They provide explanations and improve code readability

Comments exist purely to provide explanations and improve code readability for humans reading the code. They are never executed by the interpreter and are completely optional — a program runs perfectly fine without any comments at all.

Jitendra Singh
✔ Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9–12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me →