Define a dictionary. What are the advantages of using dictionary over lists.
[3 marks]Write short notes on the following methods. a. keys() c. get(key) b. values() d. clear()
[4 marks]Differentiate between the following: a. pop() and remove() methods of list. b. Del statement and pop() method of list. c. append() and insert() methods of list.
[7 marks]Identify the primary differences between a list and a tuple?
[3 marks]Explain nested dictionaries with an example.
[4 marks]Make a list of the first eight letters of the alphabet, then using the slice operation do the following operations: a. Print the first three letters of the alphabet. b. Print any three letters from the middle. c. Print the letters from any particular index to the end of the list.
[7 marks]Write a Python program to input information about a few employees as given below: a. Name b. Employee Id c. Salary The program should output the employee ID and salary of a specified employee, given his name.
[7 marks]Write the output of the below given Python program: >>> fact = "In 2012 Sachin Tendulkar became the first cricketer to score 100 centuries (100 runs in a single innings) in international play." >>> print(fact.isalpha()) >>> print(fact.title()) >>> print(fact.lower())
[3 marks]Briefly explain the slice operation of tuples with an example.
[4 marks]Write a program to take an input Nand print Fibonacci sequence till Nterms. OR1
[7 marks]Explain zip() function with an example.
[3 marks]With the help of an example explain the concept of nested lists.
[4 marks]Take an input N=5 as an integer and write a program to display a triangle with N rows and Ncolumns of * character, as shown below.
[7 marks]Differentiate the syntax of if...else and if...elif...else with an example.
[3 marks]Write a program to get the file size of a plain text file.
[4 marks]List and explain any five NumPy functions
[7 marks]Write a program to remove newline characters from a file.
[3 marks]Explain the different file mode operations with examples.
[4 marks]Given a matrix Mwrite a function Transpose which accepts a matrix Mand return the transpose of M. Transpose of a matrix is a matrix in which each row is changed to a column or vice versa. For example, if input M =2 the program shall give output N = 07 .
[12 marks]Explain NumPy integer indexing, array indexing, Boolean array indexing and slicing with examples.
[3 marks]Explain the use of range() function with an example.
[4 marks]Assuming the given table, write the python code for the following: Item Company Rupees US Dollors TV LG 12000 700 TV VIDEOCON 10000 650 TV LG 15000 800 AC SONY 14000 750
[7 marks]To create the data frame for the above table.
[ marks]To add the new rows in the data frame.
[ marks]To display the maximum price of LG TV.
[ marks]To display the Sum of all products.
[ marks]To display the median of the USD of Sony products.
Explain NumPy array creation functions with examples.
[3 marks]Write Python program to create and display a one-dimensional array-like object containing an array of data using pandas library.
[4 marks]Write a program that takes a number ‘n’ as input and prints the sum of the squares of the first ‘n’ positive integers. For example, if n = 5, the program should output 55 (1^2 + 2^2 + 3^2 + 4^2+5^2 = 55).
[7 marks]