Skip to main content

30-minute recording plan

  • 0-8 min: full-week checklist and chapter-to-skill map
  • 8-20 min: high-frequency FAQs
  • 20-27 min: trick points and common errors
  • 27-30 min: final integrated revision strategy

Quick revision checklist

Make sure you can confidently explain:
  • variable, literal, and data type
  • list vs tuple vs set vs dictionary
  • arithmetic, logical, identity, and membership operators
  • indexing, slicing, and string methods
  • type conversion and common runtime errors

Chapter-to-skill mapping

  • Chapters 1 to 3: naming, literals, input basics
  • Chapters 4 to 5: data modeling (single vs collection types)
  • Chapters 6 to 7: decision logic and operator control
  • Chapters 8 to 9: text processing for practical programs
If your exam has short coding questions, most answers combine at least 2 of these groups.

Frequently asked questions

1) What is the difference between = and ==?

  • = assigns value to variable
  • == compares two values

2) Why does input() need int() for numbers?

Because input() returns a string by default.

3) Difference between is and ==?

  • == compares values
  • is compares object identity (same object in memory)

4) Why are strings immutable?

For memory efficiency and safe behavior in many operations.

5) What is the difference between list and tuple?

  • list: mutable
  • tuple: immutable

6) Why do we use split() and join()?

  • split() converts text to list
  • join() combines list items into text

7) How can I avoid ValueError in numeric input?

  • validate input format before conversion
  • use int for whole numbers and float for decimals
  • or use try/except in practical programs
  • in exams, keep input assumptions clear in comments

8) What should I use: list or dictionary?

  • use list for ordered values (marks = [78, 84, 91])
  • use dictionary for labeled data (student["name"], student["marks"])

9) What does int() do for negative decimals?

int() truncates toward zero.
print(int(5.9))    # 5
print(int(-5.9))   # -5
It does not floor for negatives. math.floor(-5.9) is -6, which is different.

10) In this code, why do all values become same?

x, y, z = a, b, c
x = y = z
Second line uses current value of z and assigns it to x and y. Final state is x = c, y = c, z = c.

11) How to solve method-chain type MCQs?

Use this fixed approach:
  1. Evaluate left to right.
  2. After each method, write the new type (str, list, bool, int).
  3. Check if next method exists on that type.
  4. If required argument is missing, answer is Raises Error (usually TypeError).

12) Why is bool(input()) confusing?

Because user input is string text.
x = bool(input())
If input is False, then value is "False" (non-empty string), so x becomes True. Quick rule:
  • empty string -> False
  • any non-empty string -> True

13) How to identify possible outputs in if vs nested if?

  • if/elif/elif: at most one branch runs.
  • nested if: multiple prints can happen in sequence.
So always list all branches and check whether more than one can execute.

Most expected exam question types

  • define term + give example
  • output prediction from short code
  • find error and correct code
  • write short program using operators/strings

Common errors checklist

  • using = instead of == in conditions
  • forgetting int()/float() after input()
  • confusing is with ==
  • assuming sets keep insertion order in basic answers
  • attempting in-place edit on strings (s[0] = 'x')

High-value trick points (must know)

  • input() always gives str, even for numbers.
  • split() returns list of strings, not integers.
  • map(int, ...) means “convert each item to integer”.
  • == checks value; is checks object identity.
  • In slicing, end index is excluded (s[0:2] gives first 2 chars).
  • find() returns index or -1; index 0 is a valid match.
  • // is floor division, so negative cases can surprise you.
  • int() truncates toward zero, so int(-2.9) == -2.
  • x = y = z is chained assignment, not comparison.
  • for chained methods, intermediate type tracking prevents wrong options.
  • bool("False") is True because non-empty strings are truthy.
  • and/or may return operands, not just True/False.

Final showcase: one compact program

name = input("Name: ").strip().title()
marks = list(map(int, input("Enter 3 marks: ").split()))

total = sum(marks)
avg = total / len(marks)
status = "Pass" if avg >= 40 else "Fail"

summary = {
    "name": name,
    "total": total,
    "average": round(avg, 2),
    "status": status
}

print(summary)
Concepts revised in one shot:
  • input + conversion
  • list operations
  • arithmetic + conditional expression
  • dictionary output formatting
Beginner-expanded equivalent:
name_raw = input("Name: ")
name = name_raw.strip().title()

parts = input("Enter 3 marks: ").split()  # ['78', '84', '91']
marks = [int(parts[0]), int(parts[1]), int(parts[2])]

total = marks[0] + marks[1] + marks[2]
avg = total / 3

if avg >= 40:
    status = "Pass"
else:
    status = "Fail"

summary = {
    "name": name,
    "total": total,
    "average": round(avg, 2),
    "status": status
}

print(summary)

Final advice for exams

  • memorize key definitions in one notebook page
  • practice output prediction daily
  • write code with indentation and naming discipline
  • solve past paper questions in timed mode

Final mixed practice set (objective + short output)

  1. Type of input() return value?
  2. Output:
x = -8.75
print(int(x))
  1. Output:
a, b = "34"
print(a * 2, b * 3)
  1. Type of s[:2].upper().split()?
  2. Type of s.startswith("a")?
  3. What happens in s.startswith()?
  4. Choose true statement:
    • A) == checks object identity
    • B) is checks value equality
    • C) == checks value equality
  5. Output:
print(-9 // 2)
  1. Which expression gives "00042"?
    • A) f"{42:05}"
    • B) f"{42:02}"
  2. What happens in s.lowercase()?

Final mixed practice answers

  1. str
  2. -8 (int() truncates toward zero)
  3. 33 444
  4. list
  5. bool
  6. Raises TypeError (missing required argument)
  7. C
  8. -5
  9. A
  10. Raises AttributeError (lowercase is not a valid str method)