Skip to content

// Anna University, Chennai / 2026

Anna University — Problem Solving and Python Programming (GE3151), April/May 2026

Problem Solving and Python Programming · GE3151 · R2021 · B.E./B.Tech. Engineering (common paper) · Semester 1

Files open in a new tab. Use your browser's download or save option to keep a copy.

Work through the questions

15 questions

No verified answers are available for this paper.

  1. Question 1

    Part AUnit 1Descriptive2 marks

    Python

    Draw the flowchart to find the maximum value in a list.

    No verified answer or solution is available for this question.

  2. Question 2

    Part AUnit 1Descriptive2 marks

    Python

    What is meant by recursion? How is it different from iteration?

    No verified answer or solution is available for this question.

  3. Question 3

    Part AUnit 2Descriptive2 marks

    Python

    Differentiate between expression and statement.

    No verified answer or solution is available for this question.

  4. Question 4

    Part AUnit 2Descriptive2 marks

    Python

    Write a Python script to calculate the distance between two points (x₁, y₁) and (x₂, y₂).

    No verified answer or solution is available for this question.

  5. Question 5

    Part AUnit 3Descriptive2 marks

    Python

    Differentiate local and global variables.

    No verified answer or solution is available for this question.

  6. Question 6

    Part AUnit 3Descriptive2 marks

    Python

    Write a Python function to return the square of a number.

    No verified answer or solution is available for this question.

  7. Question 7

    Part AUnit 4Descriptive2 marks

    Python

    When is it preferable to use a dictionary instead of a list?

    No verified answer or solution is available for this question.

  8. Question 8

    Part AUnit 4Descriptive2 marks

    Python

    Write a Python script to extract the first three elements of a list using slicing.

    No verified answer or solution is available for this question.

  9. Question 9

    Part AUnit 5Descriptive2 marks

    Python

    State the difference between syntax errors and runtime errors.

    No verified answer or solution is available for this question.

  10. Question 10

    Part AUnit 5Descriptive2 marks

    Python

    Mention any two open modes used in the open() function.

    No verified answer or solution is available for this question.

  11. Question 11

    Part BUnits 1, 3Descriptive16 marks

    Python

    (a) (i) Explain the different forms of if statements with examples. (8 marks) (ii) Write pseudocode to insert an element into an already sorted list. Find the input and output components of this pseudocode. (8 marks) (OR) (b) (i) Evaluate the importance of functions in algorithm design with examples. (8 marks) (ii) Write pseudocode to implement the Towers of Hanoi problem. Identify the input and output components of the problem. (8 marks)

    No verified answer or solution is available for this question.

  12. Question 12

    Part BUnit 2Descriptive16 marks

    Python

    (a) (i) Explain the role of the Python interpreter and interactive mode. Compare it with a compiler. (8 marks) (ii) List and describe the different data types available in Python with examples. (8 marks) (OR) (b) Analyze how Python handles expressions with mixed data types and operator precedence using examples.

    No verified answer or solution is available for this question.

  13. Question 13

    Part BUnit 3Descriptive16 marks

    Python

    (a) (i) Explain while and for loops in Python with break and continue statements using examples. (10 marks) (ii) Write an iterative Python program to find a number in an array using binary search. (6 marks) (OR) (b) (i) Explain the composition of a function with its parameters and return values. Illustrate with examples. (8 marks) (ii) Write a recursive function to calculate the sum of the numbers stored in an array. (8 marks)

    No verified answer or solution is available for this question.

  14. Question 14

    Part BUnit 4Descriptive16 marks

    Python

    (a) Compare and contrast lists, tuples and dictionaries based on their structure, mutability and uses, with examples. (OR) (b) Design a Python program to prepare a student marks statement that calculates total, average and grade for each student using lists and dictionaries.

    No verified answer or solution is available for this question.

  15. Question 15

    Part BUnit 5Descriptive16 marks

    Python

    (a) (i) List and explain various file handling operations in Python with examples. (8 marks) (ii) Write a Python program to count the number of words in a text file. (8 marks) (OR) (b) (i) Explain how exceptions are raised and handled in Python with an example. (8 marks) (ii) Design a program to validate a voter's age, ensuring that the user input is an integer greater than or equal to 18, and handle exceptions for invalid inputs. (8 marks)

    No verified answer or solution is available for this question.

Keep preparing

Revisit another year or explore a different paper in the library.

More from this exam