0% found this document useful (0 votes)
2 views1 page

Assignment 2 Pythonn

The document outlines a series of programming concepts and questions related to Python, including topics such as __init__, inheritance, method overriding, and the super() function. It also covers data structures like lists, tuples, and sets, as well as file handling, regular expressions, decorators, and exception handling. Each question is designed to elicit explanations and examples to demonstrate understanding of these fundamental programming principles.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Assignment 2 Pythonn

The document outlines a series of programming concepts and questions related to Python, including topics such as __init__, inheritance, method overriding, and the super() function. It also covers data structures like lists, tuples, and sets, as well as file handling, regular expressions, decorators, and exception handling. Each question is designed to elicit explanations and examples to demonstrate understanding of these fundamental programming principles.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like