Class 11 Computer Science Chapter 5 Question Bank CBSE Board Pattern

QUESTION BANK

Chapter: Getting Started with Python (NCERT Class 11 Computer Science)

Section A — MCQs (10 questions, 1 mark each)

Q1. Which of the following is not a feature of Python as mentioned in the chapter?
(a) It is a high-level language
(b) It is case-sensitive
(c) It uses a compiler to translate source code
(d) It is portable and platform-independent

Q2. In Python, a comment starts with which of the following symbols?
(a) //
(b) /*
(c) #
(d) %

Q3. Which of the following is a valid Python identifier?
(a) 1stName
(b) total-marks
(c) _percentage
(d) class

Q4. Python treats every value or data item as:
(a) A keyword
(b) An object
(c) A statement
(d) An expression

Q5. Which of the following data types is immutable?
(a) list
(b) dictionary
(c) set
(d) tuple

Q6. The operator // in Python performs:
(a) Division and returns float quotient
(b) Modulus operation
(c) Floor division
(d) Exponentiation

Q7. Assertion (A): Python uses an interpreter that translates and executes statements one by one.
Reason (R): A compiler translates the entire source code at once and generates error messages after scanning the whole program.
Choose the correct option:
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false
(d) A is false but R is true

Q8. Assertion (A): Variables in Python are implicitly declared.
Reason (R): A variable must be assigned a value before it is used in an expression.
Choose the correct option:
(a) Both A and R are true and R is the correct explanation of A
(b) Both A and R are true but R is not the correct explanation of A
(c) A is true but R is false
(d) A is false but R is true

Q9. Which of the following is a membership operator in Python?
(a) is
(b) and
(c) in
(d) not

Q10. The input() function in Python always returns data of which type?
(a) int
(b) float
(c) str
(d) bool


Section B — Very Short Answer (6 questions, 2 marks each)

Q11. Define the terms “program” and “programming language” as given in the chapter.
Q12. Differentiate between interactive mode and script mode in Python (any two points).
Q13. What are Python keywords? List any four keywords from the chapter.
Q14. What will be the output of the following code?
python message = "Keep Smiling" print(message) userNo = 101 print('User Number is', userNo)
Q15. State any two rules for naming an identifier in Python.
Q16. What is the difference between a mutable and an immutable data type? Give one example of each from the chapter.


Section C — Short Answer (5 questions, 3 marks each)

Q17. Identify the error(s) in the following code and write the corrected code:
python num1 = input("Enter a number") num1 = num1 * 2 print(num1)
(Assume the user wants to double a numeric value.)

Q18. Write the output of the following code and explain the reason:
python num1 = 10 num2 = 20 num3 = num1 + num2 print(num3) print(type(num3)) num4 = float(num1 + num2) print(num4) print(type(num4))

Q19. Explain the role of comments in a Python program. How are comments written in Python?

Q20. What will be the output of the following code? Give reason.
python priceIcecream = 25 priceBrownie = 45 totalPrice = priceIcecream + priceBrownie print("The total in Rs." + str(totalPrice))

Q21. Differentiate between explicit type conversion and implicit type conversion with one example of each from the chapter.


Section D — Long Answer (3 questions, 5 marks each)

Q22. Write a complete Python program (in script mode) to find the area of a rectangle when length = 10 units and breadth = 20 units. The program should display the area. Use proper comments and follow the indentation rules.

Q23. Explain with a dry-run (trace table) how Python evaluates the following expression step-by-step:
20 + 30 * 40
Also show the evaluation of (20 + 30) * 40 and state the role of parentheses.

Q24. Write a complete Python program that accepts the first name, middle name and last name of a student using the input() function and displays the full name by concatenating the three strings with appropriate spaces.


Section E — Case/Source-Based (2 questions, 4 marks each)

Q25. A school maintains student data using a “Student Management Information System”. The system stores personal details such as name, age, class, and roll number.

(a) Which Python data type would be most suitable to store a student’s name and why?
(b) Which function will be used to accept the student’s age from the keyboard?
(c) Write a statement to convert the input age into an integer.
(d) Write a single print() statement to display the message “Student Name:” followed by the value stored in variable name.

Q26. A program is written to calculate the total marks and percentage of a student in three subjects. The marks are stored in variables marks1, marks2 and marks3.

(a) Write an expression to calculate the average using the identifiers given in the chapter.
(b) Which operator will be used to check whether the average is greater than or equal to 75?
(c) What will happen if a variable is used in an expression before it is assigned any value?
(d) Write a statement to display the average with a suitable message using the print() function.


Answer Key Attempt all questions first,
then tap to reveal

Section A

Q1. (c) — Python uses an interpreter (not a compiler).
Q2. (c)
Q3. (c) — _percentage follows all identifier rules.
Q4. (b)
Q5. (d) — Tuple is immutable.
Q6. (c)
Q7. (b) — Both true but R explains compiler, not directly why Python is interpreted.
Q8. (a)
Q9. (c)
Q10. (c)

Section B

Q11. Program: ordered set of instructions; Programming language: language used to write these instructions.
Q12. Interactive: executes one statement at a time; Script: writes multiple statements in a .py file.
Q13. Reserved words with special meaning (e.g., if, else, for, while).

Q14.

Keep Smiling User Number is 101
(Direct execution of two print statements as shown in Program 5-2.)
Q15. Must begin with alphabet or underscore; cannot be a keyword.
Q16. Mutable: value can be changed (list); Immutable: value cannot be changed (tuple/int).

Section C

Q17. Error: input() returns string; multiplication repeats string.
Corrected:
python num1 = int(input("Enter a number")) num1 = num1 * 2 print(num1)
Q18. Output:
30 <class 'int'> 30.0 <class 'float'>
(Explicit conversion using float() changes type.)
Q19. Comments improve readability and are ignored by interpreter; written using #.
Q20. The total in Rs.70str() performs explicit type conversion so + concatenates strings.
Q21. Explicit: programmer forces conversion (int(), float()); Implicit: automatic by Python (int + float → float).

Section D

Q22.

```python

Program to find area of rectangle

length = 10 breadth = 20 area = length * breadth print(area) `` **Q23.** Trace table for20 + 30 * 40: Step 1:30 * 40 = 1200(higher precedence) Step 2:20 + 1200 = 1220With parentheses:(20 + 30) * 40 = 2000. Parentheses override precedence. **Q24.** Complete program using threeinput()` calls and concatenation (as per chapter example).

Section E

Q25. (a) str (b) input() (c) int(input(...)) (d) print("Student Name:", name)
Q26. (a) (marks1 + marks2 + marks3)/3 (b) >= (c) NameError (d) print("Average is", avg)

All questions are answerable from the NCERT chapter text. Reviewed by GFIS faculty.