0% found this document useful (0 votes)
3 views10 pages

Problem Solving and Python Programming - GE3151 2021 Regulation - Question Bank

The document outlines a comprehensive curriculum on computational thinking, problem-solving, and programming concepts, divided into five units. Each unit includes various topics such as algorithms, data types, control flow, and file handling, with specific tasks and questions designed to reinforce learning. The content emphasizes practical programming skills using Python, including the use of functions, data structures, and exception handling.

Uploaded by

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

Problem Solving and Python Programming - GE3151 2021 Regulation - Question Bank

The document outlines a comprehensive curriculum on computational thinking, problem-solving, and programming concepts, divided into five units. Each unit includes various topics such as algorithms, data types, control flow, and file handling, with specific tasks and questions designed to reinforce learning. The content emphasizes practical programming skills using Python, including the use of functions, data structures, and exception handling.

Uploaded by

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

Unit I – Computational Thinking and Problem Solving

Part A

1. Define Algorithm
2. Write an algorithm to find sum of first n natural numbers
3. What are the components of a computer
4. How will you analyze the efficiency of an algorithm?
5. What is the use of algorithm, Flowchart and Pseudocode in the perspective of problem
solving? 6.Distinguish between algorithm and program.
7. Write an algorithm to find the minimum number in a given list of numbers.
8. Write an algorithm to accept two numbers. Compute sum and print the result.
9. What is a Pseudocode?
10. What are flowcharts and list down their advantages?
11. Enlist the advantages of algorithm.
12. What are the benefits of pseudocode?
13. Write down steps involved in writing a program to solve a problem.
14. Draw a flowchart to find the maximum among the three numbers.
15. What are the factors used to judge the quality of the algorithm?
16. What is control flow? List and define the ways of execution of control.
17. List the different building blocks of algorithms.
18. Define recursion.

Part B

1. Discuss about the building blocks of an algorithm (8)


2. Explain the steps to identify the computational problem (8)
3. Explain the iteration method for developing an algorithm (8)
4. Write a recursive algorithm of tower of Hanoi(8)
5. Write an algorithm to insert a card into a list of sorted cards (8)
6. What is Programming Language? What are its types? Explain them in detail with their
advantages and disadvantages.(8)
7. What is recursive function? What are its advantages and disadvantages? Compare it with iterative function(8)
8. Draw a flow chart to accept three numbers, find the greatest and print the result.(8)
9. Draw a flowchart to find the sum of the series 1+2+3+4 +100 (8)
13,Outline the Towers of Hanoi problem. Suggest a solution to the Towers of Hanoi problem with relevant
diagrams.(16)
14. Explain about algorithm, Pseudocode and flowchart with an example of finding the sum of ‘n’ numbers.(16)
15. Draw a flowchart to check whether the given number is zero, positive or negative.(6)
16. What is Pseudocode? Write a Pseudocode for swapping two numbers without using temporary storage.(6)
17. Discuss the need for logical analysis with an example in brief.(4)
18. Draw a flowchart to find the factorial of a number(6)
19. Draw a flowchart to find the sum of first 100 natural numbers.(6)
20. Write an algorithm to find the largest of three numbers.(8)
21. Draw the flowchart for finding the roots of a quadratic equation.(8)
22. What is Pseudocode? How does it differ from flowchart? Write a Pseudocode to add up all
the even numbers between 0 and 100 and print the result.(8)
23. Explain the guidelines for preparing flowcharts, benefits and limitation of flowcharts.(8)
24. Write an algorithm to compute the factorial of a number n.(8)
25. Write a Pseudocode and flowchart to add two matrices.(8)
26. Write an algorithm to print the Fibonacci series (0,1,1,2,5,8,13, )
27. Draw a flowchart to find the highest mark in a set of n marks.(8)
28. Write a Pseudocode to multiply two matrices.(8)
29. Draw the flowchart and write an algorithm to start a list of numbers in ascending order.(16)
30. Draw and explain the various symbols of flowchart and also draw the flowchart to add an array of N elements.
(16)
Unit II – Data Types, Expressions, Statement
Part A

1. Define expression with example


2. What is python comments?
3. Define statement with example
4. What is python indentation?
5. Compare interpreter and compiler. What type of translator is used for python?
6. What are keywords? Give examples.
7. State the reasons to divide programs in to functions.
8. Name the four types of scalar objects python has.
9. What is a tuple? How literals of type tuple are written? Give example.
10. Python program to exchange the values of two numbers without using a temporary variable.

Part B

1. Write about different types of python operators with example scripts (12)
2. Summarize the precedence of operators in python (4)
3. Compare interpreter and compiler. What type of translator is used for python explain with neat diagram.
(12)
4. Write a script to circulate n values (4)
5. Write a python program to rotate a list by right n times with and without slicing technique.(8)
6. Discuss about keyboard arguments and default arguments in python with example.(8)
7. Evaluate the following expressions in python (6) (i) 24//6%3 (ii)float(4+int(2.39)%2) (iii)2**2**3
8. Sketch the structures of interpreter and complier. Detail the difference between them. Explain
how python works in Interactive mode and script mode with examples.(8)
9. What is a numeric literal? Give examples.(4)
10. Appraise the arithmetic operations in Python with an example.(12)
11. Outline the operator precedence of arithmetic operators in Python.(6)
12. Write a Python Program to Exchange the Value of two variables.(4)
Unit III – Control Flow, Function, Strings
Part A

1. Differentiate while loop and for loop


2. What is meant by scope of variable in python?
3. Differentiate continue and pass
4. Write a Python program to print sum of cubes of the values of N variables.
5. Do Loop statements have else clause? When will it be executed?
6. Present the flow of execution for a while statement.
7. Define recursion with an example.
8. Write a Python program to accept two numbers, multiply them and print the result.
9. Write a Python program to accept two numbers find the greatest and print the result.
10. Write a Python program using function to find the sum of first ‘n’ even numbers and print the result
Part B

1. List the three types of conditional statements in python and explain them (16)
2. Python strings are immutable. Justify with an
example (8) 3, Describe user defined function
with example (8)
4. List the two types of looping statement in python and explain them (16)
5. Compare lists and array with example. Can list be considered as an array? Justify.(6)
6. Describe user defined function with example (8)
7. Write a function find index (), which returns the index of a number in the Fibonacci sequence, if
the number is an element of this sequence and returns-1 if the number is not contained in it, call
this function using user input and display the result.(8)
8. Write a python program print the maximum among ‘n’ randomly generate‘d’ numbers by storing them in a
list.(10)
9. If you are given three sticks. You may or may not be able to arrange them in a triangle. For
example, if one of the sticks is 12 inches long and the other two are one inch long. You will not
be able to get the short sticks to meet in the middle. For any three lengths, there is a simple test
to see if it is possible to form a triangle: if any of the three lengths is greater than the sum of the
other two, then you cannot form a triangle. Otherwise, you can.
(i) Write a function named is – triangle that takes three integers as arguments, and that
prints either “Yes” or “No”: Depending on whether you can or cannot from a triangle
from sticks with the given lengths.(4)
(ii) Write a function that prompts the user to input three stick lengths, converts them to integers, and
uses is triangle to check whether sticks with the given lengths can forma triangle.(4)
10. Write a Python program to generate all permutations of a given string using built-in function.(4)
11. Write a python function are Anagram1() to check whether two strings are anagram of each other
or not with buit- in string function and are Anagram2() to check the anagram without using built-
in function.(10)
12. Summarize the precedence of mathematical operators in python.(8)
13. Explain the syntax and structure of user defined functions in Python with examples. Also discuss
about parameter passing in functions.(12)
14. Write a python function to swap the values of two variables.(4)
15. List the three types of conditional statement and explain them.(16)
16. Write a python code perform binary search. Trace it with an example of your choice.(8)
17. Appraise with an example nested if and elif header in python(6)
18. Explain with an example while loop, break statement and continue statement in python.(10)
19. Write a Python program to find the factorial of given number without recursion and with recursion.(8)
Unit IV – List, Tuples, Dictionaries

Part A
1. List out different built-in methods used in tuple
2. Define list comprehensions in python
3. How will you update list items? Give one example.
4. Can functions return tuples? If yes give example.
5. Relate strings and lists.
6. Give a function that can take a value and return the first key mapping to that value in a dictionary.
7. What is a list? How lists differ from tuples?
8. How to slice a list in Python?
9. What is cloning list? Give example.
10. What is difference between list and tuple in python?

Part B

1. Explain in detail about python dictionary with necessary examples(16)


2. Compare and contrast tuple and list in python (4)
3. Write a script in python to sort n numbers using selection sort (12)
4. Write a python program print the maximum among’ randomly generate ‘d’ numbers by storing
them in a list.(10)
5. Define Dictionary in Python. Do the operations on dictionaries.(6)
6.What is list comprehension in python? Expression with example.(6)

7. What is tuple in python? How does it differ from list?(8)


8. Write a python program to sort N numbers using merge sort.(8)
9. Discuss the different options to traverse a list.(8)
10. Demonstrate the working of +,* and slice operators in python.(8)
11. Compare and contrast tuples and listes in python.(4)
12. Write a script in Python to sort N numbers using selected sort.(12)
13. What is a dictionary in python? Give example.(4)
14. Appraise the operations for dynamically manipulating dictionaries.(12)
15. Write a Python program to perform linear search on a list.(8)
16. Write a Python program to store ‘n’ nubers in a list and sort the list using selection sort.(8)
17. Write functions called nested_sum that takes a list of integers and adds up the elements
from all of the nested listes and cumsum that takes a list of numbers and returns the
cumulative sum; that is a new list where the ith element is the sum of the first i+1
elements from the original list.(10)
18. Take dictionaries d1 and d2 and returns a new dictionary that contains all the keys from d1 that
are not in d2.(6)
19. Write a function that takes a histogram and returns a list of word frequency tuples
and print the ten common words.(8)
Unit V- Files, Modules, Packages

Part A

1. Write notes on python module


2. How to use command line arguments in python
3. Write notes on modular design
4. Write methods to rename and delete files.
5. What is module? Give example.
6. Find the syntax error in the code given: While True print(‘Hello
world’) While True:
Print “Hello world!”
7. Write a python script to display the current date and time.
8. What are packages? How to import modules from a package?
9. How will you update the contents of one file to another file in python?
10. What is format operator?
Part B

1. Explain the commands used to read and write into a file with example (8)
2. Discuss about the use of format operator in file processing (8)
3. Describe how exceptions are handled in python with necessary examples (16)
4. Explain the commands used to read and write into a file with example (8)
5. Discuss about the use of format operator in file processing (8)
6. Describe how exceptions are handled in python with necessary examples (16)
7. What are exceptions? Explain the methods to handle them with example.(8)
8. Write a python program to count the number of words in a text file.(8)
9. How to merge multiple files in to a new using python.(6)
10. What are modules in python? How will you import them? Explain the concept by creating and
importing a module.
11. Tabulate the different modes for opening a file and explain the same.(16)
12. Appraise the use of try block and except block in python with syntax.(6)
13. Explain with an example exception with arguments in python.(10)
14. Write a program that reads a files and builds a histogram of the words in the file.(8)
15. Print all numbers present in the text file and also print the number of block spaces in that file.(8)
16. How to read or process command line arguments in python? Explain with example.

You might also like