ARIGNAR ANNA INSTITUTE OF SCIENCE AND TECHNOLOGY
PENNALUR, SRIPERUMBUDHUR
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
GE 8151 PROBLEM SOLVING AND PYTHON PROGRAMMING
MODEL EXAMINATION-1
YEAR/SEM: I / I Maximum : 100 marks
Time : 3.0 hrs. Date :
PART A (10 * 2 = 10)
1. Define iteration structure in Python.
2. Write a pseudo code to calculate the sum of n numbers.
3. Define Associativity.
4. Define scope and lifetime of the variables.
5. Define infinite loop with an example.
6. Write a program to find the sum of first N natural numbers using while loop.
7. Define append() and extend() in list.
8. What are mutable and immutable objects.
9. Write the syntax for isatty() method.
10. What are assertions in Python?
PART B
1. (a) (i) Explain the basic symbols for constructing a flowchart and state the difference
Between a program and a flowchart. (8)
(ii) Draw a flowchart to check whether a given number is zero, positive or negative. (8)
(or)
Explain the sequence, selection and iteration logic design structure in pseudo code. (16)
2. (a) (i) Briefly explain the various types of operators in Python . (12)
(ii) Write a python program to exchange the values of two variables. (4)
(or)
(b) (i) Write a python program to exchange the values of two variables without using third
variable.(4)
(ii) Explain values and Data types in Python. (12)
3. (a) (i) Briefly explain the function definition and calling in Python. (10)
(ii) Explain built in string methods in Python. (4)
(or)
(b)(i) Explain the types of looping constructs in Python.(10)
(ii) Write a program to generate Fibonacci series of N terms.(6)
4. (a) (i) Define Lists. Explain built in List methods with suitable examples . (12)
(ii) Write a program to remove duplicate elements in the array. (4)
(or)
(b) (i) Explain how to add, modify and delete elements from a dictionary. (10)
(ii) Write a program to sort an array of numbers using quick sort. (6)
5. a) (i) Explain the methods fileno(), flush(), truncate(), readlines() and getcmd() in python .(12)
(ii) Write short notes on calendar module.(4)
(or)
b) Briefly explain the concept of packages in python. (8)
a) Write a python program to determine whether a given year is a leap year or not .(8)