Question Paper Code : 60035
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2022.
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.
Write an algorithm to find smallest among three numbers.
- 2.
Which is better iteration or recursion? Justify your answer.
- 3.
List any four built in data types in Python.
- 4.
How do you assign a value to a tuple in Python?
- 5.
What are the purposes of pass statement in Python?
- 6.
What is Linear Search?
- 7.
Give examples for mutable and immutable objects.
- 8.
What is purpose of dictionary in Python?
- 9.
List any four file operations.
- 10.
Write a python program to Count Words in a sentence using spilt () function.
PART B — (5 × 16 = 80 marks)
- 11.(a)
List out the control flow statements in Python and explain repetition type in detail with a sample program.
- Or
- (b)
What is recursion? Write and explain a Python program to find factorial of number using recursion.
- 12.(a)
Why do we call python as interpreted and object-oriented programming language? Also explain about Interactive Python.
- Or
- (b)
Write and explain the python program to swap two numbers with and without temporary variables.
- 13.(a)
What is difference between break and continue in Python? Explain with suitable examples.
- Or
- (b)
What is string function in Python? Explain any three Python string methods with an example.
- 14.(a)
Define Python Lists. How to add elements to the list? Explain with a suitable example program.
- Or
- (b)
Explain bubble sort algorithm using python programming.
- 15.(a)
Why does Python require file handling? Explain opening files in python with all modes.
- Or
- (b)
Give a brief notes on Python Exception Handling using try, except, raise and finally statements.