Python Assignment-2 (Unit 2)
Answer the following questions in detail. Add suitable example wherever necessary.
1. Write a python program to define a function inside another function.
2. Write a python program to pass a function as parameter to another function.
3. Write a python program to demonstrate how a function can return another function.
4. Explain all types of arguments.
5. Explain Lambda function with example.
6. Explain filter, reduce and map with suitable examples.
7. Discuss decorator and generator.
8. Explain exception. Discuss different blocks associated with handling of exception.
9. Discuss use of assert statement.
10. Explain user defined exception. Write a program for the same.
11. Discuss File opening and different file opening modes.
12. Explain closing, reading and writing with files.
13. Write a python program to count number of lines, words and characters in a text file.
14. Write short note on Pickle and Unpickle process.
15. Explain Seek and Tell method with example.