[go: up one dir, main page]

0% found this document useful (0 votes)
33 views5 pages

PSPP QB

The document is a question bank for the course GE3151 - Problem Solving and Python Programming at P.S.V College of Engineering and Technology. It covers various units including computational thinking, data types, control flow, lists, and file handling in Python, providing both part A and part B questions for each unit. The content is designed to assess students' understanding of algorithms, Python programming concepts, and practical applications.

Uploaded by

superlion41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

PSPP QB

The document is a question bank for the course GE3151 - Problem Solving and Python Programming at P.S.V College of Engineering and Technology. It covers various units including computational thinking, data types, control flow, lists, and file handling in Python, providing both part A and part B questions for each unit. The content is designed to assess students' understanding of algorithms, Python programming concepts, and practical applications.

Uploaded by

superlion41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

P.S.

V COLLEGE OF ENGINEERING AND TECHNOLOGY


(An Autonomous Institution)
(Approved by AICTE, New Delhi and Affiliated to Anna University, Chennai)
Accredited by the NAAC with ‘A’ grade
(Inclusion Under Section 2(f) & 12(B) of the UGC Act, 1956)
(An ISO 9001:2015 Certified Institution)
Mittapalli, Balinayanapalli Post, Krishnagiri – 635 108

GE3151 – PROBLEM SOLVING AND PYTHON PROGRAMMING

QUSETION BANK

UNIT – 1 : COMPUTATIONAL THINKING AND PROBLEM SOLVING

Fundamentals of Computing – Identification of Computational Problems -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

1. What is an algorithm? List its properties.


2. Write an algorithm to accept two numbers, compute the sum and print the result.
3. Define an iterative statement.
4. Write any two disadvantages of flowchart.
5. List the symbols used to draw the flowchart.
6. Differentiate Algorithm and Pseudocode and flowchart
7. What is recursion?
8. Write a simple python program to find the sum of first 100 integers.
9. Write an algorithm to find minimum among 3 numbers.
10. State the qualities of good algorithm.

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

1. List any four built in data types in python.


2. What are the rules for writing an identifier?
3. Identify the operand(s) and operator(s) in the following expression. Sum = a + b.
4. What is slicing operator in python? Give example.
5. How do you assign a value to a tuple in python.
6. Are comments executable statements in python? How comments are included in a python
program?
7. Python variables do not have specific types. Justify this statement with an example.
8. What are the types of arguments in python?
9. What is indentation in python? Give an example.
10. Mention the features of list in python.

PART-B

1. Outline the data types supported by python with an example.


2. Name the types of operators supported by python and outline any four with an example.
3. Write and explain python program to swap two numbers with and without temporary variables.
4. Write and explain python program to circulate n numbers with and without using slicing operator.
5. (i) What is precedence? List out the order of precedence and demonstrate in detail with example.
(ii) Write a python program to check whether a given year is leaf year or not.
6. (i) Write a python program to calculate the distance between 2 points.
(ii) Write an algorithm to convert Celsius to Fahrenheit.

GE3151-Problem Solving and Python Programming Question Bank


UNIT III CONTROL FLOW, FUNCTIONS, STRINGS

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

1. What are the purposes of pass statement in python?


2. What are the two types of recursive function supported in python?
3. What is linear search?
4. Define fruitful function.
5. Write a python program to add two matrices.
6. Write a simple function to two numbers in python.
7. Compare return value and composition.
8. Define string immutability.
9. What is “len” function? Give an example for how to use it in strings.
10. How to split strings and what function is used to perform that operation?

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.

GE3151-Problem Solving and Python Programming Question Bank


UNIT IV - LISTS, TUPLES, DICTIONARIES

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

1. Give examples for mutable and immutable objects.

2. Define cloning in list.

3. What is range function? How it is used in lists?

4. In python, how the values stored in a list are accessed? Should the elements of a list be of
the same data type?

5. Write a program to create a clone of a list: List1=[1,2,3,4,5,6].

6. What is the purpose of dictionary in python?

7. What is the benefit of using tuple assignment in python?

8. What are the advantages of tuple over list?

9. How python dictionaries store data? Give example.

10. How are the values of tuples accessed? Give example.

11. What are list comprehensions? Mention its advantages.

12. Differentiate List and Tuple in python.

PART – B

1. Explain selection sort algorithm using python programming.

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.

S.No. No. of units consumed Price (Domestic) Price (Commercial)


1 Upto 200 units 200 500
2 Units>200 and <500 1100 1700
3 Units >=500 4500 7000

4. Explain python dictionaries in detail discussing its operations and methods.

5. Explain python tuple operations with example.

GE3151- Problem Solving and Python Programming Question Bank


UNIT V - FILES, MODULES, PACKAGES

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

1. List any four file operations.

2. Write a syntax for opening a file to write in binary mode.

3. Define relative path and absolute path with respect to files.

4. How do you delete a file in python?

5. Write the significance of format operator.

6. Write a python program to count words in a sequence using split() function.

7. What are the different modules in python?

8. What are exceptions?

9. What are command line arguments? How to use command line arguments to insert data.

10. How exceptions are handled in python?

11. What is module and package in python?

12. List few common exception types.

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.

GE3151- Problem Solving and Python Programming Question Bank

You might also like