21cs15it Problem Solving and Python
21cs15it Problem Solving and Python
First Semester
(Regulations 2021)
IMPORTANT QUESTIONS
S.NO UNIT-I
1. Explain in detail about the various building blocks of algorithm.
2. Write pseudo code, algorithm and flowchart to check whether the given number is
palindrome or not.
3. Explain in detail about the Operators in Python.
4. (i) Explain the data types in python.
(ii) Write the following python programs.
1. To find the sum of ‘n’ natural numbers.
2. To convert Celsius to Fahrenheit.
5. List the different operators in python and estimate the precedence of execution.
6. Summarize the difference between algorithm, flowchart and pseudocode.
S.NO UNIT-II
1. Explain in detail about conditional statement with example.
2. Explain in detail about iterative statement with example.
3. (i) Describe user defined function with example.
(ii) Explain about the built-in function.
4. Write the syntax and explain the concept of
(i) Recursive function with an example.
(ii) Lambda function with an example.
5. Write a program to determine the factorial of a given number with and without the use
of recursion.
6. (i). Write a python program to find the greatest among three numbers.
(ii). Write a program to check the given number is Armstrong number or not.
S.NO UNIT-III
1. Explain how module allows to logically organize Python code.
2. Explain with example about the packages in python.
3. Describe in detail about string functions.
4. Create a program to determine whether a string is a palindrome or not.
5. Write a Python program to count the number of vowels in a string provided by the user.
6. (i) Define methods in a string with an example program using at least 5 methods.
(ii) How to access characters of a string?
S.NO UNIT-IV
1. Write about tuple operation and tuple methods with example.
2. Explain in detail about list operation and its methods.
3. Write a python program to perform all set operation with example.
4. Describe the methods and operations of dictionaries.
5. Evaluate the different operations like union, intersection and differences of list using
Set and functions.
6. Write a function that takes a number as an input parameter and returns the corresponding
text in words, for example, on input 452, the function should return ‘Four Five Two’.
Use a dictionary for mapping digits to their string representation.
S.NO UNIT-V
1. Discuss the different modes for opening a file and closing a file.
2. Explain in detail about file methods.
3. Describe in detail about exception handling with Python program.
4. (i) Describe the use of try block and except block in Python with syntax.
(ii) Describe with an example, exceptions with arguments in Python.
5. (i) Explain with example of writing a file
(ii) Discover syntax for reading from a file
6. Explain with an example to copy the contents of one file to another.