Define following terms in the context of Python programming: 1) Operator, 2) Statement and 3) Variable
[3 marks]What is precedence? Compare different arithmetic operators in terms of precedence.
[4 marks]Explain Decision control flow statements if…elif…else with example.
[7 marks]Give syntax and explain following built-in python functions: max(), abs() and pow()
[3 marks]Write a program that fulfills following conditions: 1) ‘while’ loop is executed 6 times only. 2) Use ‘True’ as the Boolean Expression for while loop. 3) Each execution of the loop must print the number of iteration of the loop. 4) The loop must terminate and the program should not generate any error message nor should it be an infinite loop.
[4 marks]Write a program to get 5 numerical inputs from the user and display the sum and average of these numbers. Also display the largest and smallest value entered by the user.
[7 marks]Explain with example the use of Index Number in accessing characters in a string. Give following two examples of string slicing using index number on the string you have selected above. 1) Positive indexing with step size of 2. 2) Combination of positive and negative indexing
[7 marks]Explain basic list operations.
[3 marks]Differentiate between following for list: 1) append() and insert() 2) pop() and remove()
[4 marks]Consider following list : locale = [“Mirzapur”, “Azgard”, “Gotham”, “NY”, “Jotunheim”] Apply following methods on the given list (write proper syntax for the method) in given order and write what will be the output of these methods: count(), index(), sort(), insert(), reverse(),pop() and copy() For insert() method add location ‘Batcave’ such that sorting is not broken
[7 marks]What is user defined function? Why are they useful in programming?1
[3 marks]Explain *args and **kwargs for functions.
[4 marks]Explain graphing methods in python.
[7 marks]What is immutable data? Explain tupple as immutable data type with necessary example.
[3 marks]Explain tupple packing and unpacking.
[4 marks]What is zip() function? Write a python program to illustrate the use of zip() function.
[7 marks]What are sets and frozenset? Explain and compare them.
[3 marks]Explain the properties of set.
[4 marks]Explain following methods of sets with proper syntax and example: add(), difference(), intersection(), issubset(), remover(), symmetric_difference() and union()
[7 marks]Enlist the properties of ‘Dictionary’ class.
[3 marks]Give example of all the methods to create a dictionary.
[4 marks]For the below given dictionary, write a program to demonstrate traversing using ‘for’ loop. Also, write the output of your program. The output must give a sentence mentioning the state name and corresponding capital for all the pairs in the dictionary. capital = {"Gujarat": "Gandhinagar", "Maharashtra": "Mumbai", "Bihar": "Patna", "Tamilnadu": "Chennai", "Assam": "Dispur"}
[7 marks]Enlist methods associated with File Object.
[3 marks]What is NumPy? Explain in brief.
[4 marks]Explain file types and different access modes available in python to access a file.
[7 marks]