// 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.
Draw the flowchart to find the maximum value in a list.
No verified answer or solution is available for this question.
What is meant by recursion? How is it different from iteration?
No verified answer or solution is available for this question.
Differentiate between expression and statement.
No verified answer or solution is available for this question.
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.
Differentiate local and global variables.
No verified answer or solution is available for this question.
Write a Python function to return the square of a number.
No verified answer or solution is available for this question.
When is it preferable to use a dictionary instead of a list?
No verified answer or solution is available for this question.
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.
State the difference between syntax errors and runtime errors.
No verified answer or solution is available for this question.
Mention any two open modes used in the open() function.
No verified answer or solution is available for this question.
(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.
(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.
(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.
(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.
(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.