QB python
QB python
3. Write a python program to read contents of first.txt file and write same content in second.txt file.
9. Write a Python program to create a class ‘Diploma’ having a method ‘getdiploma’ that prints “I got a
diploma”. It has two subclasses namely ‘CO’ and ‘IF’ each having a method with the same name that prints
“I am with CO diploma” and ‘I am with IF diploma’ respectively. Call the method by creating an object of
each of the three classes.
10. Define Data Hiding concept? Write two advantages of Data Hiding.
11. Explain method overloading and overriding in python.
12. Write a program to create class student with Roll no. and Name and display its contents
13. With neat example explain default constructor concept in Python
14. Describe 'Self Parameter with example
15. Design a class student with data members : name, roll no., department, mobile no. Create suitable
methods for reading and printing student information.
19. Design a class student with data members : name, roll no., department, mobile no. Create suitable
methods for reading and printing student information
20. Explain how try-catch block is used for exception handling in python Explain how to use user defined
function in python with example.
21. Write a program for importing module for addition and subtraction of two numbers.
22. Write a program to open a file in write mode and append some content at the end of file.
23. Write a program to show user defined exception in Python.