Question Paper Code : 21184
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2023.
First Semester
Civil Engineering
GE 3151 — PROBLEM SOLVING AND PYTHON PROGRAMMING
(Common to : All Branches)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
What is Algorithm?
- 2.
What are the simple strategies for developing algorithms?
- 3.
List the various single valued data types in Python.
- 4.
What is an indentation in python? Give an example.
- 5.
Write a for loop that prints numbers from 0 to 57 using the range function in python.
- 6.
What is the fruitful function in python?
- 7.
What are List Comprehension? Mention its advantages.
- 8.
What is a tuple in python? Give an example.
- 9.
Write the significance of format operator.
- 10.
How exceptions are handled in python?
PART B — (5 × 16 = 80 marks)
- 11.(a)
- (i)What are the building blocks of algorithm, explain in detail.(6)
- (ii)Discuss the various process to the smallest value in the list a = [18, 52, 23, 41, 32] and write a simple python program for the same.(10)
- Or
- (b)
- (i)Explain the logic of the Tower of Hanoi puzzle and write a simple python program for the same and mention the time complexity.(12)
- (ii)Define the computational problem and how these problems are classified.(4)
- 12.(a)
- (i)Explain the python interpreter and interactive mode in detail.(12)
- (ii)What operator has the highest precedence in Python?(4)
- Or
- (b)
- (i)Write a python program to calculate the distance between two points.(8)
- (ii)Explain the different Boolean and bitwise operator types in Python?(8)
- 13.(a)
- (i)Illustrate the different types of control flow statements in Python with flowcharts.(12)
- (ii)Explain any two string formats available in Python.(4)
- Or
- (b)
- (i)Discuss the binary search algorithm with time complexity and write a python to implement the same using the recursive method.(12)
- (ii)Why are strings in Python immutable?(4)
- 14.(a)
- (i)Discuss the differences and applications of List, Tuple, and Dictionary in Python.(12)
- (ii)Explain any cloning list technique in python.(4)
- Or
- (b)
- (i)Discuss Python dictionaries and list some of their methods.(8)
- (ii)Write a simple sorting python program to sort different data types.(8)
- 15.(a)
- (i)Explain in detail python files, their types, functions, and operations that can be performed on files with examples.(12)
- (ii)Differentiate between Python Modules and Packages.(4)
- Or
- (b)
- (i)Write a simple python program to count the number of words in the sentence using the split method and list other count methods.(12)
- (ii)What are command line arguments in python?(4)