Question Bank-Problem Solving and Python Program
Question Bank-Problem Solving and Python Program
Question Bank-Problem Solving and Python Program
Unit -I
SYLLABUS
Algorithms, building blocks of algorithms (statements, state, control flow, functions), notation (pseudo code,
flow chart, programming language), algorithmic problem solving, simple strategies for developing algorithms
(iteration, recursion). Illustrative problems: find minimum in a list, insert a card in a list of sorted cards, guess
an integer number in a range, Towers of Hanoi.
PART – A
Q.No Questions
7 Explain list
8 Explain Iteration
9 Define simple computational problem
10 Assess problem solving method.
11 What is meant by sorting ? mention its types
12 Develop algorithm for Celsius to Fahrenheit and vice versa
13 Define programming language
14 Identify the function types
15 Examine a simple program to print the integer number from 1 to 50
16 Discuss building blocks of algorithm
17 Discover the steps of simple strategies for developing algorithms.
18 Differentiate user defined function and predefined function
19 Analyze the notations used in algorithmic problem solving
20 Describe some example for recursion function
PART-B (13 MARK )
1 Explain the algorithm GCD and find LCM
Discuss with suitable examples
2
i)Find minimum in a list
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
Unit -II
SYLLABUS
Python interpreter and interactive mode; values and types: int, float, boolean, string, and list; variables,
expressions, statements, tuple assignment, precedence of operators, comments; modules and functions,
function definition and use, flow of execution, parameters and arguments; Illustrative programs: exchange the
values of two variables, circulate the values of n variables, distance between two points
PART - A
Q.No Questions
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
3 ii) Discuss the various operation that can be performed on a tuple and
Lists (minimum 5)with an example program.
i)How the area of circle is calculated explain with an example.
ii) Describe a program to calculate student result based on two
4
examinations, one sports event and three activities conducted. The
weightage of the activity = 30%, sports =20%, and examination=50%
Demonstrate the various expressions in python with suitable
5
examples.
i)What is membership and identity operators.
ii) Write a program to perform addition, subtraction, multiplication,
6
integer division, floor division and modulo division on two integer and
float.
i)Formulate the difference between type casting and type coercion
with suitable example
7 ii) Write a a program to print the digit at ones place and hundreds
place of a number.
iii) Write a program to convert degree Fahrenheit to Celsius
i) Discuss the need and importance of function in python.
8 ii) Illustrate a program to exchange the value of two variables with
temporary variables
Briefly discuss in detail about function prototyping in python. With
9
suitable example program
i)Analyze the difference between local and global variables.
10 ii) Explain with an example program to circulate the values of n
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
variables.
i) Describe in detail about lambda functions or anonymous function.
11 ii) Describe in detail about the rules to be followed while using
Lambda function.
i)Explain with an example program to return the average of its
12 argument
ii) Explain the various features of functions in python.
i)Describe the syntax and rules involved in the return statement in
python
13
ii) Write a program to demonstrate the flow of control after the return
statement in python
i)Analyze with a program to find out the distance between two
14 points using python.
ii) Write a program to calculate the simple interest using python.
PART - C (15 MARK )
Explain how to write and execute a program in python illustrate the
1 steps for writing a python program to check whether the number is
palindrome or not.
i)Formulate with an example program to pass the list arguments to a
function
2
(ii)Write a program to perform selection sort from a list of numbers
using python
Do the Case study and perform the following operation in tuples i)
Maxima ii)minima iii)sum of two tuples iv) duplicate a tuple v)slicing
3
operator vi) obtaining a list from a tuple vii) Compare two tuples
viii)printing two tuples of different data types
i)Formulate with an example program to find out all the values in the
4 list that are greater than the specified number.
ii)Write a program to find out the square root of two numbers
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
Unit -III
SYLLABUS
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
Q.No Questions
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
1
121 Creating BTL 6
12321
1234321
Unit -IV
SYLLABUS
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: selection sort, insertion sort, merge
sort, Histogram.
PART - A
Q.No Questions
6 List out the methods that are available with list object in python
programming
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
16 Can you use the addition assignment operator, +=, with two
lists? What is the result?
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
(i)Discuss
a)Tuples as return values
11 b)Variable Length Argument Tuples
(ii) Write a program to illustrate the comparison operators in
tuple
A polygon can be represented by a list of (x, y) pairs where
each pair is a tuple: [ (x1, y1), (x2, y2), (x3, y3) , … (xn, yn)].
Write a
Recursive function to compute the area of a polygon. This can
12
be accomplished by “cutting off” a triangle, using the
Exploring Python– Chapter 4 - Strings, Lists and Tuples 24 fact
that a triangle withcorners (x1, y1), (x2, y2), (x3, y3) has area
(x1y1 + x2y2 + x3y2 – y1x2 –y2x3 – y3x1) / 2.
(i)Explain the properties of Dictionary keys with examples
13
(ii) Illustrate the python Dictionary Comprehension with
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
examples
Write a python program named Weather that is passed a
dictionary of daily temperatures , and returns the average
14
temperature over the Weekend for the weekly temperatures
given.
PART - C (15 MARK )
Create a python program to perform selection sort on the elements
1
Read from the user.
Unit -V
SYLLABUS
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.
PART - A
Q.No Questions
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
10 Write a program towrite a data in a file for both write and append
modes.
11 How to import statements?
12 Express about namespace and scoping.
13 Difference between global and local.
14 Identify what are the packages in python
15 Examine buffering.
16 Discuss File.isatty[].
17 Discover except Clause with Multiple Exceptions.
18 Differentiate mutable.
19 Analyze the object as return values.
20 Describe built – in class attribute.
PART-B (13 MARK )
1 Write a Python program to demonstrate the file I/O operations
Discuss with suitable examples
2 i) Close a File.
ii) Writing to a File.
i) Write a program to catch a Divide by zero exception. Add a finally block
3 too.
ii)Write a function to print the hash of any given file in python
(i) Describe in detail about Exception with Arguments
4
(ii) Describe in detail about user – defined Exceptions.
(i) Explain with example of closing a file
5
(ii) Discover syntax for reading from a file
i). Structure Renaming a file
6
ii). Explain about the Files Related Methods.
i). Describe the import Statements
7
ii). Describe the from…import statements
8 Describe in detail locating modules
9 Identify the various methods used to delete the elements from the
dictionary
www.BrainKart.com
Click Here for Problem Solving and Python Programming full study material.
www.BrainKart.com