Define following terms and give 1 example for each 1. List Cloning 2. Global and Non-Local variables 3. String Slicing 4. Assert Statement 5. Tuple 6. Dictionary 7. ** Operator
[7 marks]Choose the correct answer for the following questions: 1. Which of the following is correct set of mutable sequence objects in Python?
[7 marks]List and Tuple c) List, Tuple and Dictionary
[ marks]List and Dictionary d) Tuple and Dictionary 2. Which of the following is used as a constructor in Python class?
[ marks]init() b) init(self) c) __init__(self) d) __init__() 3. __________________ is a mutable sequence object of python which utilizes Hash Table technique to search the data with key.
[ marks]List b) Tuple c) Dictionary d) All of these 4. The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.
[ marks]# b) @ c) $ d) & 5. Which of the following is correct syntax of “lambda” function used for total of two values?
[ marks]total = lambda arg1, arg2: arg1 + arg2;
[ marks]total = lambda [arg1, argu2[:[arg1 + arg2];
[ marks]total = lambda arg1+arg2;
[ marks]total = lambda 6. If str = “Mera Bharat Mahan”, what will be the output of print(x[-12:] ?
[ marks]“Bharat Mahan” c) Error
[ marks]“B” d) “Mera B” 7. What will be the output of following line? x = [“GTU”, “Python”, 12, 2023] print(“GTU” in x)1
[ marks]True b) 0 c) GTU d) Error
[ marks]Explain looping statements available in Python. Specify examples of while and for loop
[7 marks]Explain Relational operators in Python with suitable examples.
[7 marks]What is recursion? Write down program to find factorial of a number with recursive function.
[7 marks]Briefly explain file handling in Python with open(), close(), write() and readLines() methods with suitable example.
[7 marks]How to implement constructor overloading in Python? Explain using example.
[7 marks]How a ‘class’ is defined in Python? Explain a class variable and constructor. How data hiding in applied in Python?
[7 marks]What do you mean by exception handling? Explain how exception handling is done in Python in detail.
[7 marks]Explain below function of pylab library with suitable examples. 1.figure(), 2. plot(), 3.savefig(), 4.title(), 5.xlabel(), 6.ylabel(), 7. legend()
[7 marks]Explain lambda function in python with its use in filter() in-built function.
[7 marks]Discuss various operations, sorting and indexing on the Data Frame.
[7 marks]Explain following methods of pyplot with example. 1. hist() 2. pie() 3. bar()
[7 marks]What is database adapter? Write a Python program to perform insert update and delete operations with the given table: (department(DNO, DNAME)).
[7 marks]1. Explain Modules and its uses in Python with example. 2. How the class Inheritance is done in python? Explain with example.
[7 marks]Differentiate between fetchone() and fetchall() methods with examples.
[7 marks]What is Regular Expression? Explain Special Character and Quantifiers in Regular Expressions in Python.
[7 marks]