563 – The Mandvi Education Society Institute of Computer Studies
MCA Semester II – Question Bank
Subject Code: 629403 Subject Name : Programming in Python Submission
Q.1 Answer the following Short Question
1. Define Python Virtual Machine. 2. Example of multi-line comment in python. 3. Define built-in data type. 4. What is frozenset? 5. Define interperter in Python. 6. Write the output of print(fabs(-4.55)). 7. Difference between function and method. 8. Define Positional arguments. 9. What is ‘self’ variable? 10.Define Namespaces. 11. What is pass statement? 12. Define print() statement. 13. What type of language is python? 14. What are local variables and global variables in Python? 15. What are functions in Python? 16. What is init ? 17. What is pickling and unpickling? 18. What does this mean: *args, **kwargs? And why would we use it? 19. Explain the function which is used to retrieve the parts of URL. 20. What is PyLab? Write simple program to plot using PyLab. 21. Explain assertion using suitable example. 22. i) Explain load() and display() methods of pickle for an Employee class (EmpId, Name, Salary). 23. Explain seek(), tell() and read() methods using suitable example. 24. Differentiate between match() and search() methods of 're' module. 25. Discuss findall(), split() and sub() methods using suitable example. 26. Explain how to use urlparse() and urlretreive() function. 27. Discuss \D, {m} and ? special characters used in regular expression usingsuitable example Answer the following Question 1. Discuss the features of python in detail. 2. Explain comments in Python. 3. Explain garbage collection in Python. 4. Comparison between ‘C’ and “Python”. 5. Discuss Built-in Datatypes. 6. Comparison between “Java” and “Python”. 7. Explain sequences in Python. 8. Discuss in detail assignment operator. 9. Discuss at least 6 mathematical in-built functions with appropriate example. 10. Discuss difference between tuple and list. 11. Explain input and print statement in detail with proper example. 12. Explain exception handling in Python. 13. Disscuss defining, calling and returning results of user define function. 14. Explain lambdas with filter(), map() and reduce() function. 15. Explain recursive function. 16. Explain file methods seek(), tell(), write(),writeline(), read(), readline(), readable() & writeable() with example. 17. Explain types of files in python. 18. Explain working with binary file with example. 19. What is polymorphism? Explain method overloading and operator overloading with example. 20. What is inheritance? What are the different types of inheritance available in python? Explain each with example. 21. Briefly describe the methods of regular expression. How to use regular expressions on file? Explain with example. 22. Which are the different ways of creation of threads? Explain each with an example. 23. What is Protocol? What are the different types of protocol model based on which other protocol model developed? Write a Python program for TCP/IP chat application. 24. What is Data Frame? List out ways of creating data frame and explain any one with example. Also list out operations on data frame and explain anyone with example. 25. List various ways to create threads in python. Discuss any one in detail. 26. Write a program to implement class named “Cart” having methods: Add Itemand change Item Quantity (Use Database Interface). 27. A company has started its business since last 6 years with investment of Rs.1,00,000. The profit ratio of all five year is given as 12%, 9%, 8%, -6%, 10% and 11% respectively. Write a program to prepare PyLab graph to show profitand Discuss various methods used to plot graph in python. 28. How to insert, update and delete rows into mysql database using python? Write a program to demonstrate all these operations. 29. Explain Formal arguments, Actual Arguments, Positional Arguments, Keyword Arguments and Default Arguments using add()function, which will accept two variables and returns sum. 30. What is the importance of thread? Discuss thread communication using notify()and wait() methods.
31. Write a program to retrieve and display all rows
from Employee Table (Structure(EmpNo,Name,Salary)) using fetchone() method. Discuss changesrequired in code, if fetchall() is used in place of fetchone().
32. Assume that EMP.CSV file contains ( empid, name,
salary, gender, DOB, date_join). Write a python statement to do following operations in Data frame a. Create a data frame from emp.csv file. b. Retrieve number of rows and columns c. Retrieve 3rd row to 4th rows from data frame d. Retrieve employee id and name of employees whose salary is not morethan 10000 e. Display emp record in sorted order of date of joining. f. Display all rows having minimum salary g. make empid as an index column
33. What is the use of MatPlotLib in Python? Explain the
use of plot(), show() and title()functions of MatPlotLib.
34. Explain various python function used to manipulate
table (Insert, Update, Delete) with Mysql database. 35. What are regular expressions in Python? How to find out that an email id entered by a user is valid or not using the python ‘re’ module.