You are on page 1of 2

Roll No.

ANNA UNIVERSITY (UNIVERSITY DEPARTMENTS)

B.E / B. Tech (Full Time) END SEMESTER EXAMINATIONS – APR/ MAY 2021
NAME OF THE BRANCH
First Semester
GE5153 & PROBLEM SOLVING AND PYTHON PROGRAMMING
(Regulation 2019)
Time:3Hours AnswerALLQuestions Max. Marks100
PART- A (10 x 2 = 20Marks)

Q.No Questions Marks


1. Write an algorithm to accept two numbers, compute the product and print the 2
result.
2. Define value. 2
3. Define recursion function. 2
4. Comment with an example on the use of local and global variable with the same 2
identifier name.
5. What is aliasing? 2
6. What are the advantages of tuple over list? 2
7. What is a module? Give example. 2
8. What is meant by key-value pairs in a dictionary? 2
9. List the different modes for opening a file. 2
10. What is the purpose of seek () function? 2

PART- B (5 x 13 = 65Marks)
(Restrict to a maximum of 2 subdivisions)

Q.No Questions Marks


11. a) i) What is an algorithm? Summarize the characteristics of a good algorithm. 7
ii) Draw a flowchart to accept three distinct numbers, find the smallest and 6
print the result.
OR
b) i) Appraise the arithmetic operators in python with an example. 10
ii) List out the rules to be followed in naming an identifier. 3
12. a) Explain the syntax and structure of user defined functions in python with 13
examples. Also discuss about parameter passing in functions?
OR
b) i) Write a python program to find the factorial of a given number with recursion 7
and without recursion.
ii) Explain with an example for loop, while loop and break statement in python. 6
13. a) What are the basic list operations that can be performed in python? Explain 13
each operation with its syntax and example.
OR
b) Demonstrate with code the various operations that can be performed on 13
tuples.
14. a) What is a dictionary? Explain python dictionaries in detail discussing its 13
operations and methods.
OR
b) i) What is a string? How is it accessed? 3
ii) Explain any ten built-in string functions with its example. 10
15. a) i) Explain the commands used to read and write into a file with examples. 8
ii) Design a python code to count the number of words in a python file. 5
OR
b) Describe how exceptions are handled in python with necessary examples. 13

PART- C (1 x 15 = 15 Marks)
(Q. No 16 is Compulsory)
Q.No Questions Marks
16. i) Write a python program to count the number of strings where the string length 8
is 2 or more and the first and the last character are same from a given list of
strings.
Sample list: [‘abc’, ‘xyz’, ‘aba’, ‘1221’]
Expected result: 2

ii) Write a python program to check whether a given key already exists in a 7
dictionary.

You might also like