Python file
Python file
11. Create a Python class Student with attributes name and grade. Use
the__str__ and __len__ in-built functions to customize the string
representation and length of the object.
12. Create a base class Animal with a method sound. Create a derived class
Dog that overrides the sound method to print & quot; Woof & quot;. Create
an object of the Dog class and call its sound method.
13. Create a Python class named Car with attributes brand and model. Create
an object of this class and print its attributes
14. Write a Python function that takes a list as an argument and returns the sum
of all the elements in the list. Test this function with a sample list
15. Write a Python function named operate that takes two numbers and an
operation as arguments. The operation can be add, subtract, multiply, or
divide. Use lambda functions to perform the respective operations.
19. Create a Tkinter window with an entry field. When a button is clicked,
display the entered text in a message box
OUTPUT:
Code-2:
Output:
Code-3
Output:
Code-4:
Output:
Code-5:
Output:
Code-6:
Output:
Code-7
Output:
Code-8:
Output:
Code-9:
OUTPUT:
Code-10:
:
OUTPUT:
CODE-11:
OUTPUT:
Code-12:
Output:
Code-13:
OUTPUT:
Code-14:
Output:
Code-15:
Output:
CODE-16:
OUTPUT:-
Code-17.:
Output:
CODE-18:
OUTPUT:
CODE-19:
OUTPUT:
CODE-20:
OUTPUT: