Python Programming (BCC302 / BCC402) Important Questions
AKTU B.Tech · 2nd Year · Exam 2026-27. Worked out from 14 real papers, 2019-20 to 2025-26.
- 14AKTU papers analysed
- 19must-do topics
- 16repeated 2-mark questions
The PDF has every topic with the years it came, a unit-wise plan and the sources. Free. Share it with your class.
Most likely question in each unit
| Unit | Most likely | Backup topics |
|---|---|---|
| 1Variables, operators, data types, type conversion, Python blocks | Operators: types, precedence, is vs ==, // (all 6 BCC papers) | Data types & type conversion (4 of 6 BCC) · Python basics / IDE |
| 2if / elif / else, for & while loops, range, break / continue / pass | Loops: for vs while, range, nested loops / star pattern (6/6 BCC) | if-elif-else program (grades, positive/negative) · break, continue, pass · number programs (prime, LCM, table) |
| 3Strings, lists, tuples, sets, dictionaries, functions, lambda, list comprehension | Strings: methods + program (6/6 BCC), or list vs tuple / sets (6/6 BCC) | Dictionary CRUD & programs (5/6 BCC) · Functions & arguments · list comprehension (due) |
| 4File handling: modes, read/readline/readlines, write/writelines, seek(); regex | File modes + a file program (count words / copy file) | read/readline/readlines & seek() (hot) · Regular expressions (new) |
| 5Packages: NumPy, Pandas, Matplotlib; Tkinter GUI; modules; OOP | Tkinter GUI program (5/6 BCC) or Matplotlib line / pie chart (5/6 BCC) | NumPy matrix ops / Pandas DataFrame & CSV · Packages · OOP inheritance (2025-26) |
Must-do topics
These came in most of the 14 papers. Prepare them first.
Operators (types, precedence & associativity, // vs /, is vs ==, membership)
came in 13 of 14 papersUnit 1 · 2019-20 to 2025-26
How to answer: Table of operator types with one example each: arithmetic (/ vs // vs % vs **), relational, logical (short-circuit), bitwise, assignment, membership (in, not in), identity (is, is not). Precedence order (** > unary > * / // % > + - > shifts > & > ^ > | > comparisons > not > and > or) and one expression solved step by step. is vs ==: same object vs same value.
Last asked (2025-26 (carry-over), Section C): Explain arithmetic operators, operator precedence, and Boolean expressions in Python.
Loops: for vs while, range, loop-else, nested loops & pattern programs
came in 13 of 14 papersUnit 2 · 2019-20 to 2025-26
How to answer: Syntax + flowchart of for and while; range(start, stop, step); for over string/list/dict; else block runs when loop ends without break. Table for vs while. Nested loops: right triangle, pyramid, hollow pyramid of stars (print('*'*i), end='').
Last asked (2025-26 (carry-over), Section C): Explain the for loop in Python with a suitable program.
Strings: slicing, built-in methods & string programs (vowels, palindrome, removekth)
came in 13 of 14 papersUnit 3 · 2019-20 to 2025-26
How to answer: Slicing s[start:stop:step] incl. s[::-1]. Methods: lower, upper, strip, replace, find, count, split, join, startswith, isdigit. Programs: count vowels, palindrome, swap first & last char, remove k-th character, character frequency in a dict, longest word, count digits/upper/lower.
Last asked (2025-26, Section C): Write a Python program demonstrating the use of in-built functions for strings, lists, and dictionaries.
List vs tuple, tuples, sets & complex data types (mutable vs immutable, unpacking)
came in 13 of 14 papersUnit 3 · 2019-20 to 2025-26
How to answer: Table list vs tuple (mutable/immutable, [] vs (), speed, methods). Tuple packing/unpacking (a, b = b, a), single-element tuple (5,), 'adding' to a tuple via conversion. Sets: unique & unordered, add/remove/discard, union/intersection/difference. Mutable vs immutable types.
Last asked (2025-26 (carry-over), Section C): Explain tuples, lists, and sets in Python and differentiate between mutable and immutable data structures.
Number programs (prime, factorial, Fibonacci, LCM, calculator, multiplication table)
came in 12 of 14 papersUnit 2 · 2019-20 to 2025-26
How to answer: Practise short programs with input(): prime check & primes in a range, factorial, Fibonacci series, LCM/GCD, reverse a number, leap year, perfect square, factors of N, multiplication table, simple calculator (+ - * /), swap without temp (a, b = b, a).
Last asked (2025-26, Section C): Write a Python program using conditional statements and loops to print the multiplication table of a number.
File handling: open, file modes, with statement, file I/O operations
came in 11 of 14 papersUnit 4 · 2019-20 to 2025-26
How to answer: open(name, mode) and close(); modes table: r, w, a, r+, w+, a+, x, b (text vs binary). The with statement closes the file automatically. Program: create P.txt, write your name, read it back.
Last asked (2025-26 (carry-over), Section C): Explain file input and output operations in Python with their importance.
File programs (count lines/words/chars, copy file, odd/even numbers, reverse content)
came in 10 of 14 papersUnit 4 · 2019-20 to 2025-26
How to answer: Practise: count lines, words and characters; copy one file to another; write odd and even numbers to ODD.TXT / EVEN.TXT; reverse the content and separate characters with commas; capitalise each word; write student records; print words made of digits only.
Last asked (2025-26, Section C): Write a Python program to create a file and write multiple lines into it.
Variables, data types (numeric, string, boolean) & type conversion
came in 9 of 14 papersUnit 1 · 2019-20 to 2025-26
How to answer: Variables are names bound to objects (no declaration, dynamic typing). Data types: int, float, complex, bool, str, list, tuple, set, dict, with type(). Implicit vs explicit conversion: int('5'), float(3), str(10), int(input()). Local vs global variables. Program: convert between int, float and str.
Last asked (2025-26 (carry-over), Section C): What is type conversion in Python? Explain with examples.
Dictionaries: methods, CRUD & dictionary programs
came in 9 of 14 papersUnit 3 · 2022-23 to 2025-26
How to answer: Create, access, update, delete (CRUD) with d[k], get(), update(), pop(), del, keys(), values(), items(), looping over items(). List vs dictionary. Programs: sum of all values, merge two dicts, student grades, character frequency, dict of squares 1..n.
Last asked (2025-26 (carry-over), Section C): What is list comprehension in Python? Explain dictionaries and their uses.
Modules & packages (import, from-import, creating a module, __name__)
came in 9 of 14 papersUnit 5 · 2020-21 to 2025-26
How to answer: Module = .py file; package = folder of modules (__init__.py). import m, from m import f, from m import *, import m as x. Create library.py and use it in main.py. if __name__ == '__main__' lets a file run as a script and be imported.
Last asked (2025-26 (carry-over), Section A): Explain modules in Python.
break, continue & pass (loop manipulation)
came in 8 of 14 papersUnit 2 · 2019-20 to 2025-26
How to answer: break exits the loop, continue skips to the next iteration, pass does nothing (placeholder). One small loop example for each with its output. pass vs comment: pass is a statement the interpreter executes, a comment is ignored.
Last asked (2025-26 (carry-over), Section C): Explain Python IDE in detail. Also, discuss Break and Continue keyword.
Lists: slicing, built-in methods & list programs
came in 8 of 14 papersUnit 3 · 2019-20 to 2025-26
How to answer: Indexing & slicing L[a:b:c] (reverse, even positions, middle onward). Methods: append vs extend, insert, remove, pop, sort, reverse, count, index. Programs: remove duplicates, sum of list, smallest/largest sub-list, numbers less than k, pair two lists (zip), shuffle (random.shuffle).
Last asked (2025-26, Section B): Explain list and dictionary in-built functions.
Functions: definition, parts, arguments (default, keyword, variable-length), scope
came in 8 of 14 papersUnit 3 · 2019-20 to 2025-26
How to answer: def, parameters, return; fruitful vs void function. Argument types: positional, default, keyword, *args, **kwargs, with one call each. Local vs global scope. Programs: area of circle, sum of a list, calculator using functions.
Last asked (2025-26 (carry-over), Section B): Explain the parts of a function in Python and describe how a function is executed.
List comprehension
came in 8 of 14 papersUnit 3 · 2019-20 to 2025-26 · DUE: missing in last 3 BCC papers
How to answer: Syntax [expr for x in seq if cond] with 3 examples: squares, even numbers, filter Fahrenheit). Predict outputs like [i**2 for i in x if i%2==0].
Last asked (2025-26 (carry-over), Section C): What is list comprehension in Python? Explain dictionaries and their uses.
Conditional statements: if, elif, else, nested if & Python blocks (indentation)
came in 7 of 14 papersUnit 2 · 2019-20 to 2025-26
How to answer: Syntax + flowchart of if, if-else, if-elif-else, nested if. Blocks are defined by indentation (4 spaces), no braces. Programs: even/odd, positive/negative/zero, grade from marks with elif, largest of three.
Last asked (2025-26 (carry-over), Section C): Write a Python program to check whether a number is even or odd using if-else statement.
read, readline, readlines, write, writelines & seek: file pointer
came in 5 of 14 papersUnit 4 · 2023-24 to 2025-26 · HOT: seek() in 3 of the last 4 BCC papers
How to answer: read(n) whole/n chars, readline() one line ('' at EOF), readlines() list of lines; write(str) vs writelines(list). tell() gives position, seek(offset, whence) moves the file pointer (0 start, 1 current, 2 end). Programs: copy a file, read last n lines.
Last asked (2025-26, Section B): What is the purpose of the seek() method in file handling? Demonstrate a program that copies content from one file to another.
Matplotlib plotting (line, bar, pie charts)
came in 5 of 14 papersUnit 5 · 2023-24 to 2025-26
How to answer: import matplotlib.pyplot as plt; plt.plot(x, y), plt.bar, plt.pie(values, labels=...), plt.xlabel/ylabel/title/legend, plt.show(). Write a full program for a line graph x = [1..5] and a pie chart of given data.
Last asked (2025-26, Section C): How is Matplotlib used in Python? Write a program to plot a simple line graph.
NumPy & Pandas (arrays, matrix operations, DataFrame, CSV files)
came in 5 of 14 papersUnit 5 · 2023-24 to 2025-26
How to answer: NumPy: np.array, arange vs linspace, np.eye/identity, np.random.randint, matrix add/multiply (np.dot), why NumPy is faster than lists. Pandas: Series & DataFrame from a dict, pd.read_csv, filtering rows (df[df['marks'] > 50]), mean per row/column.
Last asked (2025-26, Section B): What are Python packages? Explain the purpose of packages like NumPy, Pandas, and Matplotlib.
Tkinter GUI programming (widgets, events, calculator / form)
came in 5 of 14 papersUnit 5 · 2023-24 to 2025-26
How to answer: Steps: import tkinter, root = Tk(), create widgets (Label, Button, Entry, Text, Frame), pack/grid, mainloop(). Event binding: widget.bind('', handler) or command=. Programs: window with a label, student-data form, calculator with + - * / and clear.
Last asked (2025-26, Section C): What is Tkinter? Explain the role of Tkinter in GUI programming using Python.
High-chance topics
- Python basics: features, interpreted & dynamically typed, programming cycle, IDEUnit 1 · came in 10 of 14 papers
- Lambda, higher-order functions, map & filterUnit 3 · came in 7 of 14 papers
- Exception handling (try-except-finally, raise, assert)Unit 4 · came in 7 of 14 papers
- OOP in Python (class, __init__, encapsulation, inheritance, polymorphism)Unit 5 · came in 6 of 14 papers
- Iterators & generatorsUnit 3 · came in 5 of 14 papers
- Regular expressions (re module)Unit 4 · came in 2 of 14 papers
Repeated 2-mark questions (Section A)
- Floor division / difference between / and //asked 4 times
- Python arrays vs listsasked 4 times
- List vs tuple / mutable sequences / single-value tupleasked 4 times
- for vs while / else with a loop / while loopasked 4 times
- OOP: __init__, encapsulation, inheritanceasked 4 times
- Programming cycle for Pythonasked 3 times
- Variables / declaring numeric data typesasked 3 times
- read() vs readline() / readline() at end of fileasked 3 times
- Lambda / higher-order functionsasked 3 times
- Why Python is interpreted / dynamically & strongly typed / how it stands outasked 3 times
- Interface for an ADTasked 3 times
- Importing a module / using library.py in main.py / modulesasked 3 times
- Exceptions: raise / assert / try-exceptasked 3 times
- NumPy: linspace vs arange, identity matrix, why NumPyasked 3 times
- pass vs comment / break and continueasked 3 times
- Membership / identity operators (== vs is)asked 2 times
The 10 programs to practise by hand
- Count vowels / character frequency in a string (return a dict)
- Palindrome string and remove the k-th character
- Prime numbers in a range, factorial, LCM, multiplication table
- Star triangle / pyramid / hollow pyramid with nested loops
- Dictionary CRUD + merge two dictionaries + sum of values
- List slicing set (reverse, even positions, middle) + remove duplicates
- Count lines, words, characters of a file; copy a file using seek()
- Matplotlib line graph and pie chart from given data
- NumPy matrix operations + Pandas DataFrame from a dict / read_csv filter
- Tkinter window with Label, Entry and Button (student form or calculator)
Get the Python Programming PDF
Not official AKTU material. The important questions are based on 14 previous year papers (2019-20 to 2025-26). The real paper can differ. Syllabus cross-checked with the official AKTU B.Tech 2nd Year Common Courses syllabus (BCC302/BCC402/BCC302H/BCC402H, effective 2023-24) and the B.Tech 2nd year CSE scheme (70 external + 30 internal, 2 credits). Research date: 20 Nov 2026.
More subjects: all B.Tech papers. Practise coding for free on Kinetic CodeGuide.