Computer Workshop (Python Programming) (CY-306) - Important Questions
-
Unit 27 Marks High Priority
Explain the difference between a list and a tuple in Python. Give at least two code examples showing creation, indexing, slicing, and an example scenario where a tuple is preferred over a list.
Core topic: fundamental conceptual difference often asked in Unit 2 (Lists vs Tuples).
-
Unit 27 Marks High Priority
Write a Python function to reverse a list without using the built-in reverse() method or slicing. Show the function and its output for a sample input list.
Core programming task on list manipulation and string/list algorithms frequently used in exams.
-
Unit 27 Marks High Priority
Write a Python program to find the maximum and minimum elements in a list of integers without using the built-in max() and min() functions. Demonstrate the program with a sample list.
Basic algorithmic operation on lists; tests use of loops and conditional logic rather than built-ins.
-
Unit 24 Marks High Priority
Using list comprehension, create a list of squares of even numbers between 1 and 20. Also show how to produce the same result using an explicit for-loop.
List comprehensions are core language feature frequently examined for concise data transformations.
-
Unit 210 Marks Medium Priority
Write a Python program to sort a list of integers using the bubble sort algorithm. Show the code and the output for a sample unsorted list.
Sorting algorithms applied to lists test students' understanding of nested loops and swaps; typical 10-mark coding question.
-
Unit 27 Marks High Priority
Explain the structure of a Python dictionary. Demonstrate with code how to create a dictionary, access values safely, add a new key-value pair, update an existing key, and delete a key.
Fundamental dictionary concepts and methods (creation, access, update, deletion) — core Unit 2 material.
-
Unit 210 Marks High Priority
Write a Python program that reads a list of words and uses a dictionary to compute and display the frequency of each word. Show the program and its output for a sample list of words.
Standard application of dictionaries for counting/frequency analysis; common exam programming question.
-
Unit 27 Marks Medium Priority
Given a nested data structure such as a list of dictionaries or a dictionary containing lists, write code to access and modify a deeply nested element. Provide a concrete example and show before-and-after states.
Working with nested data structures (lists of lists, dicts inside lists etc.) is an essential skill in Unit 2.
-
Unit 25 Marks Medium Priority
Write Python code to convert a list of two-element tuples into a dictionary. Then show code to convert a dictionary back into a list of (key, value) tuples.
Conversion between sequence and mapping types tests ability to transform data structures.
-
Unit 25 Marks Medium Priority
Demonstrate three ways to merge two dictionaries in Python and explain how key conflicts are handled in each method. Provide code examples and a sample result where both dictionaries share some keys.
Merging dictionaries and resolving key conflicts is a practical dictionary operation often assessed in exams.
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel