Python code Snippets
Unit 5
Atharva S Narale
Q. Create a class named Rectangle, and also include a method to find
its area.
Output
Area is 200
Q. Create a class named ‘Employee’ and add two attributes to it and
include method to display data of each(here 2) employee.
Output
Q. Write a python code to create a class that would store marks of
four subjects. Use list to store marks of four subjects.
Output:
Q. Create a class named “Car” having two attributes (name and price)
and display that information.
Output