PSPP QB
PSPP QB
QUSETION BANK
PART- A
PART-B
1. Outline the towers of Hanoi problem. Suggest the solution by writing appropriate algorithm,
pseudo code and flowchart.
2. i. Draw a flowchart to accept three distinct numbers, find the greatest and print the result.
ii. Draw a flowchart to find the sum of the series. 1+2+3+……..+100
3. Explain in detail about the building blocks of algorithms.
4. Discuss briefly about the strategies for developing the algorithms.
5. List out the control flow statements in python and explain repetition type in detail with a sample
program.
6. (i) Identify the simple strategies to develop an algorithm
(ii) Write an algorithm to insert card in a list of sorted cards
GE3151-Problem Solving and Python Programming Question Bank
UNIT II DATA TYPES, EXPRESSIONS, STATEMENTS
Python interpreter and interactive mode, debugging; values and types: int, float, boolean, string, and list;
variables, expressions, statements, tuple assignment, precedence of operators, comments; Illustrative
programs: exchange the values of two variables, circulate the values of n variables, distance between two
points.
PART- A
PART-B
Conditionals: Boolean values and operators, conditional (if), alternative (if-else), chained conditional (if-
elif-else); Iteration: state, while, for, break, continue, pass; Fruitful functions: return values,
parameters, local and global scope, function composition, recursion; Strings: string slices, immutability,
string functions and methods, string module; Lists as arrays. Illustrative programs: square root, gcd,
exponentiation, sum an array of numbers, linear search, binary search.
PART- A
PART-B
1. What is the difference between break and continue in python? Explain with suitable example.
2. Outline the conditional branching statements in python with an example.
3. What is string function in python? Explain any 3 python string methods with example.
4. Write a python program to find square root of a number without using in built function and
explain the same.
5. (i) Explain call by value and call by reference in python.
(ii) How to perform a user input in python? Explain with example.
6. (i) Briefly explain about function prototype.
(ii) Write a python program to check whether the entered string is palindrome or not.
Lists: list operations, list slices, list methods, list loop, mutability, aliasing, cloning lists, list
parameters; Tuples: tuple assignment, tuple as return value; Dictionaries: operations and methods;
advanced list processing – list comprehension; Illustrative programs: simple sorting, histogram,
Students marks statement, Retail bill preparation.
PART – A
4. In python, how the values stored in a list are accessed? Should the elements of a list be of
the same data type?
PART – B
2. Define python lists. Explain list operations and list slices with example program.
3. Write a program to generate electricity bill based upon the no. of units consumed. Refer the
table below for unit and price details.
Files and exception: text files, reading and writing files, format operator; command line
arguments, errors and exceptions, handling exceptions, modules, packages; Illustrative programs:
word count, copy file, Voter’s age validation, Marks range validation (0-100).
PART – A
9. What are command line arguments? How to use command line arguments to insert data.
PART – B
1. Name the different access modes for opening a file and present an outline of the same.
2. Give a brief notes on python exception handling using try, except raise and finally
statements.
3. Explain the use of packages and modules in python with example.
4. Write a python program to count number of lines, words and characters in a text file.
5. Explain opening and closing of a file in python using examples.