Semester : S1 and S2
Year : 2018
Term : DECEMBER
Branch : MECHANICAL ENGINEERING
Scheme : 2015 Full Time
Course Code : BE 101-05
Page:2
D R1909 Pages: 3
il. To display the number of items in the dictionary
111. To remove the key value pair (‘orange’:2)
12 ‘Lists are mutable while tuples are immutable’ Justify the statement. (3)
13 Write the output of the following print statements in python. 1
>>>f=open(test.txt,’w”) (2)
>>>f.write(“Apples\nMangoes\nGrapes”)
>>>f.close()
>>>f=open(test.txt,r’”)
>>>print f.readline()
>>> print f.readlines()
14 Explain the use of dump() and 10200 methods in python. (3)
15 Predict the output of statement1 and statement2
class ABC:
A=10
def ಗಿ10:
A=5
print A
Obj=ABC()
print A //statement1
Obj.fun() //statement2
PART 13
Answer any four full questions, each carries 8 marks.
16 What is memory hierarchy? Explain with a neat diagram. Compare in terms of (8)
speed, cost and storage.
17 Give an algorithm and flow chart to find the largest among N numbers (8)
18 Write a Python program to print the odd composite numbers between m and 1, (8)
where m and n are positive integers greater than 1.
19 Write a menu driven Python program to input a number and implement the (8)
following operations. Use separate functions to implement each operation.
i) check whether the number is odd or even
1) check whether the number is positive, negative or zero
Page 2 of 3