Skip to content
TestMacher
Chapter 4 · Class 11 Informatics Practices

Introduction to Python — Important Questions

34 questions With answers CBSE format

SUMMARY: This chapter introduces students to the basics of Python programming, including its syntax and fundamental concepts.
KEY TOPICS: Python syntax, variables, data types, operators, input/output functions, conditional statements, loops, functions, error handling, Python IDEs

Q1 1 Mark

Which of the following is a valid Python identifier?

A2name
Bname_2
Cname 2
Dfor
Check answerHide answer
Correct answer: Option 2 — name_2
Q2 1 Mark

Which keyword is used to define a function in Python?

Afunction
Bdef
Cfun
Ddefine
Check answerHide answer
Correct answer: Option 2 — def
Q3 1 Mark

The output of print(7 // 2) in Python is:

A3.5
B3
C4
D3.0
Check answerHide answer
Correct answer: Option 2 — 3
Q4 1 Mark

Lists in Python are:

AMutable
BImmutable
CConstants
DHashable only
Check answerHide answer
Correct answer: Option 1 — Mutable
Q5 1 Mark

Tuples in Python are:

AMutable
BImmutable
CHashable
DBoth immutable and hashable
Check answerHide answer
Correct answer: Option 4 — Both immutable and hashable
Q6 3 Marks

Differentiate between mutable and immutable data types in Python.

Q7 3 Marks

List any three rules for naming a variable in Python.

Q8 3 Marks

Differentiate between list and tuple in Python.

Q9 3 Marks

What is the difference between print() and input()?

Q10 3 Marks

How are dictionaries different from lists in Python?

Q11 6 Marks

Write a Python program to find the largest of three numbers using if-elif-else.

Q12 6 Marks

Write a Python program to compute the factorial of a number using a for loop.

Q13 6 Marks

Discuss different types of operators in Python with examples.

Q14 6 Marks

Write a Python function that takes a list and returns the sum and average of its elements.

Q15 6 Marks

Write a Python program to count the number of vowels and consonants in a string.

Q16 6 Marks

Differentiate between mutable and immutable data types in Python in tabular form.

Q17 1 Mark

Assertion (A): Python is dynamically typed.

Reason (R): Variables do not need to be declared with a type.

Show explanationHide explanation
Correct answer: Option 1 — Both A and R are true, and R is the correct explanation of A.
Q18 1 Mark

Assertion (A): Indentation is mandatory in Python.

Reason (R): It defines blocks of code.

Show explanationHide explanation
Correct answer: Option 1 — Both A and R are true, and R is the correct explanation of A.
Q19 1 Mark

Assertion (A): Strings are immutable in Python.

Reason (R): Once created their characters cannot be changed.

Show explanationHide explanation
Correct answer: Option 1 — Both A and R are true, and R is the correct explanation of A.
Q20 1 Mark

Assertion (A): Lists can store elements of different data types.

Reason (R): Python lists are heterogeneous.

Show explanationHide explanation
Correct answer: Option 1 — Both A and R are true, and R is the correct explanation of A.
Q21 1 Mark

Assertion (A): Dictionaries are unordered collections.

Reason (R): Items are accessed by key not position.

Show explanationHide explanation
Correct answer: Option 1 — Both A and R are true, and R is the correct explanation of A.
Q22 1 Mark

Statement 1: A list is created using square brackets.

Statement 2: Lists support indexing and slicing.

Show answerHide answer
Correct answer: Option 1 — Both statements are true.
Q23 1 Mark

Statement 1: A tuple is created using parentheses.

Statement 2: Tuples are faster than lists for iteration.

Show answerHide answer
Correct answer: Option 1 — Both statements are true.
Q24 1 Mark

Statement 1: A dictionary stores key-value pairs.

Statement 2: Keys must be unique and immutable.

Show answerHide answer
Correct answer: Option 1 — Both statements are true.
Q25 1 Mark

Statement 1: Comments in Python begin with #.

Statement 2: They are ignored by the interpreter.

Show answerHide answer
Correct answer: Option 1 — Both statements are true.
Q26 1 Mark

Statement 1: The input() function returns a string by default.

Statement 2: Use int() or float() for type conversion.

Show answerHide answer
Correct answer: Option 1 — Both statements are true.
Q27 3 Marks
An intern is writing a Python program to compute simple interest using the formula SI = (P * R * T) / 100. He uses input() to read the three values then computes and prints SI. He also wants to print the maturity amount A = P + SI.
  1. To assign a value to a variable in Python use:
    A=
    B==
    C=:
    Dis
  2. What does input() return by default?
    Aint
    Bfloat
    Cstr
    Dbool
  3. Write the complete Python program with proper type conversion.
Show answersHide answers
1. Option 1 — =
2. Option 3 — str
3. Program: P = float(input('Principal: ')); R = float(input('Rate: ')); T = float(input('Time: ')); SI = (P * R * T) / 100; A = P + SI; print('SI =' SI); print('A =' A). The input() function always returns a string so we use float() to convert. Without conversion the formula would fail or behave unexpectedly.
Q28 5 Marks

Identify the data type of each Python literal.

LiteralType
42?
3.14?
'Hello'?
True?
[1, 2, 3]?
(1, 2, 3)?
Q29 6 Marks

Predict the output of each Python expression.

ExpressionOutput
3 + 2 * 4?
10 / 3?
10 // 3?
10 % 3?
2 ** 3?
'ab' * 3?
Q30 6 Marks

Predict the output of each list operation.

Operation on a = [1, 2, 3]Result
a.append(4)?
a.extend([5, 6])?
a.insert(0, 0)?
a.remove(3)?
a.pop()?
Q31 6 Marks

Predict the output of each string operation.

s = 'Hello World'Result
len(s)?
s.upper()?
s[0:5]?
s[-1]?
s.split()?
'World' in s?
Q32 3 Marks

Study the Python data type hierarchy and answer:

Introduction to Python figure
  1. Which of the following is a MUTABLE data type?
    Aint
    Blist
    Cstr
    Dtuple
  2. Which is an immutable sequence?
    Alist
    Bdict
    Ctuple
    Dset
  3. Differentiate between mutable and immutable data types in Python with examples.
Show answersHide answers
1. Option 2 — list
2. Option 3 — tuple
3. Python data types are categorised as Numeric (int float complex) Sequence (list tuple str) Mapping (dict) and Set. Mutable types (list dict set) can be changed in place; immutable types (int float str tuple) cannot.
Q33 3 Marks

Study the Python operator precedence diagram and answer:

Introduction to Python figure
  1. Which has the HIGHEST precedence in Python?
    A**
    B* / //
    C( )
    Dnot
  2. Which has the LOWEST precedence?
    Aand
    Bor
    Cnot
    D==
  3. Discuss Python operator precedence and how parentheses override it.
Show answersHide answers
1. Option 3 — ( )
2. Option 2 — or
3. Operator precedence determines the order of evaluation in expressions. Parentheses have the highest precedence followed by exponentiation multiplicative operators additive operators comparison logical NOT logical AND and finally logical OR. Use parentheses to override the default precedence.
Q34 3 Marks

Study the list vs tuple vs dict comparison and answer:

Introduction to Python figure
  1. Which is IMMUTABLE?
    Alist
    Btuple
    Cdict
    DAll
  2. Which uses curly braces { } and indexes by key?
    Alist
    Btuple
    Cdict
    Dset
  3. Compare list tuple and dict on five features.
Show answersHide answers
1. Option 2 — tuple
2. Option 3 — dict
3. Lists are mutable ordered indexed by position use [ ]. Tuples are immutable ordered indexed by position use ( ). Dicts are mutable ordered (3.7+) indexed by key use { : }. Tuples are faster than lists and can serve as dict keys (because they are immutable and hashable).

Make a full Informatics Practices paper on Introduction to Python.

Pick the question mix, set the marks, hit generate. You get a ready-to-print paper with an answer key.

Generate your paper — free