Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

B.E./B.Tech.

DEGREE EXAMINATION, 2018


First Semester B.E./B.Tech. DEGREE EXAMINATION, 2018
GE8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING First Semester
MODEL EXAMINATION GE8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING
Time : Three Hours Maximum : 100 Marks MODEL EXAMINATION
Answer ALL questions Time : Three Hours Maximum : 100 Marks
PART – A (10×2=20 Marks) Answer ALL questions
1. What is an algorithm ? PART – A (10×2=20 Marks)
2. Write a pseudo-code to accept two numbers, add the 1. What is an algorithm ?
numbers and print the result. 2. Write a pseudo-code to accept two numbers, add the
3. Outline the modes Python interpreter works. numbers and print the result.
4. State the difference between (I) and (II) operators in Python. 3. Outline the modes Python interpreter works.
5. Write a Python program to accept two numbers, find the 4. State the difference between (I) and (II) operators in Python.
greatest and print the result. 5. Write a Python program to accept two numbers, find the
6. What is recursion ? greatest and print the result.
7. What is a list in Python ? Give example. 6. What is recursion ?
8. Write the syntax for concatenating two lists in Python. 7. What is a list in Python ? Give example.
9. What is an exception ? Give example. 8. Write the syntax for concatenating two lists in Python.
10. Write the syntax for opening a file in Python for reading 9. What is an exception ? Give example.
only. 10. Write the syntax for opening a file in Python for reading
PART – B (5×16=80 Marks) only.
11. a) i) Explain with an example the building blocks of an algorithm. (8) PART – B (5×16=80 Marks)
ii) Draw a flow chart to print the first ‘n’ prime numbers. (8) 11. a) i) Explain with an example the building blocks of an algorithm. (8)
(OR) ii) Draw a flow chart to print the first ‘n’ prime numbers. (8)
b) Explain with relevant diagrams and algorithm the Towers of Hanoi (OR)
problem. (16) b) Explain with relevant diagrams and algorithm the Towers of Hanoi
12. a i) Explain with an example the structure of a Python program. (8) problem. (16)
ii) Outline with an example the assignment operators supported 12. a i) Explain with an example the structure of a Python program. (8)
in Python. (8) ii) Outline with an example the assignment operators supported
(OR) in Python. (8)
b) Explain the various data types in Python. (16) (OR)
13. a) i) Write a Python program using while loop to print the first n b) Explain the various data types in Python. (16)
numbers divisible by 5. (8) 13. a) i) Write a Python program using while loop to print the first n
ii) Write a Python program to compute the factorial of a given numbers divisible by 5. (8)
number. (8) ii) Write a Python program to compute the factorial of a given
(OR) number. (8)
b) Write Python program to perform binary search. (16) (OR)
14. a) Write code snippets in Python to perform the following : b) Write Python program to perform binary search. (16)
i) Accessing elements of a tuple. (5) 14. a) Write code snippets in Python to perform the following :
ii) Modifying elements of a tuple. (5) i) Accessing elements of a tuple. (5)
iii) Deleting elements of a tuple. (6) ii) Modifying elements of a tuple. (5)
(OR) iii) Deleting elements of a tuple. (6)
b) Write the Python program to sort an integer list using selection sort. (16) (OR)
15. a) Describe in detail how exceptions are handled in Python. Give b) Write the Python program to sort an integer list using selection sort. (16)
relevant examples. (16) 15. a) Describe in detail how exceptions are handled in Python. Give
(OR) relevant examples. (16)
b) Write a Python program to copy the contents of one file to another. (16) (OR)
b) Write a Python program to copy the contents of one file to another. (16)

You might also like