Answer:
Following is given the code for the given question. All the instructions are defined with help of comments. Output is also attached to make the concept clear. I hope it will help you a lot.
Step-by-step explanation:
6.5m questions
8.6m answers