Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 1.12 KB

JSON_and_OOPS_Assignment.md

File metadata and controls

16 lines (10 loc) · 1.12 KB

Create an assignment for File handling of JSON files in Python

Assignment 1

👉 1. Create a JSON file (employee.json) containing employee information of minimum 5 employees. Each employee information consists of Name, DOB, Height, City, State. Write a python program that reads this information from the JSON file and saves the information into a list of objects of Employee class. Finally print the list of the Employee objects.

👉 2. Create a dictionary of any 7 Indian states and their capitals. Write this into a JSON file.

Assignment 2

👉 1. Create a class named ‘Dog’. It should have a constructor which accepts its name, age and coat color. You must perform the following operations:

🔴 a. It should have a function ‘description()’ which prints the name and age of the dog.
🔴 b. It should have a function ‘get_info()’ which prints the coat color of the dog.
🔴 c. Create child classes ‘JackRussellTerrier’ and ‘Bulldog’ which is inherited from the class ‘Dog’. It should have at least two methods of its own.
🔴 d. Create objects and implement the above functionalities.