Do as directed.
[ marks]Write syntax of “lambda” function to sum of two variables ( x & y). ii) Give one example of List comprehension. 01 iii) What is the difference between extend() and append() methods of list. 01 iv) Give one guideline for defensive coding. 01
[ marks]What is recursion? vi) What is driver and stub in python? 01 vii) What happens if a local variable exists with the same name as the global 01 variable you want to access?
[ marks]Say TRUE of FALSE with justification.
[7 marks]List and Tuple are immutable sequence objects in python. ii) Binary search needs sorted array while merge sort does not need sorted array. iii) Two parameters of pylab.plot() must be sequences of the same length. iv) fp=open("aa.txt","w") will errored out if file does not exists.
[ marks]_name =1 is invalid statement. vi) Suppose d = {“A”:10, “B”:45}, d.remove() command will delete the entry for “A”. vii) Functions and Methods are same.
[ marks]State in your words "+" operator overloading and __add__() method overloading in python.
[7 marks]Write a python program which will implement following methods using class: Structure(ItemId, ItemName, Qty,Rate)
[7 marks]Constructor to initialize ii) AddItem() to add Items and store into file (item.txt) iii) display() will display all items via reading file (item.txt)
[ marks]Acompany having turnover=[100000,120000,154000,180000,205000] and profit percentage =[9,9.5,9.25,9,9.5] of past 5 years. Draw line chart showing growth of profit ( in amount) and turnover using pylab module in python. Draw both graph in same figure.
[7 marks]What is exception? Explain how to handle user defined exception in python (Give example)?
[7 marks]Compare List, Tuple and Dictionary data types.
[7 marks]Write exception block in python. How to use exception as a control flow mechanism?
[7 marks]What is Defensive programming? Discuss assertion using suitable example.1
[7 marks]What is function? How it differs from methods? Discuss use of default parameters in function using suitable example.
[7 marks]Differentiate between
[7 marks]Linear search and Binary search ii) Selection sort and merge sort
[ marks]What is module? Why we need module? Discuss various ways to use module.
[7 marks]Differentiate between
[7 marks]Dynamic Programming and Divide & conquer ii) Black box and White box testing
[ marks]Explain how dynamic programming solve knapsack 0/1 problem.
[7 marks]What is abstract data type? Explain inheritance using suitable example in python.
[7 marks]Explain class and generators using suitable example in python.
[7 marks]What fallacies, consistencies, inconsistencies appear during implementation of recursion?
[7 marks]