Assignment-2
1. What is __init__? Explain with example.
2. What is inheritance? Explain multiple inheritance. Why multiple inheritance supported in
python explain with example.
3. What is method overriding? Explain method overriding with example.
4. What is super() function? Explain with example.
5. Explain the difference between class attribute and instance attribute.
6. What is polymorphism? Explain polymorphism with example.
7. What is encapsulation? Explain private variable with example.
8. What is list? What do you mean by list comprehension? Explain append() with an example.
9. Explain difference between extend() and insert() with example.
10. Explain difference between list ,tuple and set.
11. What is set? Explain operations of the set.
12. Explain frozenset.
13. What do you mean by file handling? List out types of files and explain open(),read(),write()
and close() with an example.
14. What is context manger? Explain why we are using ‘with’ statement with an example.
15. What is regular expression? Explain difference between [Link]() and [Link]()
16. What is ‘r’ in regular expression?
17. Explain difference between [Link]() and [Link]().
18. What is decorators? Explain with example.
19. What is itertools? Explain combinations() and permutations() with an example.
20. What is exception handling? Explain try,except,else and finally block along with example.
21. How to raise an exception? Explain with an example use of raise.
22. What is custom exception?
23. Write the difference between Array and list.
24. How to create an array using numPy explain with an example.
25. What is difference between error and exception.