// Anna University, Chennai / 2019
Anna University — Problem Solving and Python Programming (GE8151), December/January 2019
Problem Solving and Python Programming · GE8151 · R2017 · 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.
Distinguish between an algorithm and a program.
No verified answer or solution is available for this question.
Write an algorithm to find the minimum number in a given list of numbers.
No verified answer or solution is available for this question.
What are keywords? Give examples.
No verified answer or solution is available for this question.
State the reasons to divide programs into functions.
No verified answer or solution is available for this question.
Present the flow of execution for a while statement.
No verified answer or solution is available for this question.
- 2026
- 2019
Also asked in Anna University — Programming in C (CS3251), April/May 2026 (2026).
Define recursion with an example.
No verified answer or solution is available for this question.
- 2022
- 2019
Also asked in Anna University — Problem Solving and Python Programming (GE3151), November/December 2022 (2022).
Relate strings and lists.
No verified answer or solution is available for this question.
Give a function that takes a value and returns the first key mapping to that value in a dictionary.
No verified answer or solution is available for this question.
What is a module? Give an example.
No verified answer or solution is available for this question.
Find the syntax error in the code given: while True print ('Hello world')
No verified answer or solution is available for this question.
(a) (i) Discuss the building blocks of algorithms. (8 marks) (ii) Write a recursive algorithm to solve the Towers of Hanoi problem. (8 marks) (OR) (b) (i) Identify the simple strategies for developing an algorithm. (8 marks) (ii) Write an algorithm to insert a card into a list of sorted cards. (8 marks)
No verified answer or solution is available for this question.
(a) (i) Sketch the structures of an interpreter and compiler, detail the differences, and explain how Python works in interactive mode and script mode with examples. (2 + 2 + 4 marks) (ii) Summarize the precedence of mathematical operators in Python. (8 marks) (OR) (b) (i) Explain the syntax and structure of user-defined functions in Python with examples. Also discuss parameter passing in functions. (12 marks) (ii) Write a Python function to swap the values of two variables. (4 marks)
No verified answer or solution is available for this question.
(a) List the three types of conditional statements and explain them. (16 marks) (OR) (b) (i) Python strings are immutable. Justify with an example. (8 marks) (ii) Write Python code to perform binary search. Trace it with an example of your choice. (8 marks)
No verified answer or solution is available for this question.
(a) (i) Discuss the different options to traverse a list. (8 marks) (ii) Demonstrate the working of +, * and slice operators in Python. (8 marks) (OR) (b) (i) Compare and contrast tuples and lists in Python. (4 marks) (ii) Write a Python script to sort n numbers using selection sort. (12 marks)
No verified answer or solution is available for this question.
(a) (i) Explain the commands used to read and write into a file with examples. (8 marks) (ii) Discuss the use of the format operator in file processing. (8 marks) (OR) (b) Describe how exceptions are handled in Python with examples. (16 marks)
No verified answer or solution is available for this question.