Skip to content
CY-306 · Computer Workshop (Python Programming)/Important Questions

Computer Workshop (Python Programming) (CY-306) - Important Questions

  1. 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).

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in