Make a program that prints the table of contents of a book where each chapter has the same number of sections, and each section has the same number of subsections.
Make a
Example:
Please enter the number of chapters
3
Please enter the number of sections
3
Please enter the number of subsections
3
Chapter 1
-Section 1.1
--Subsection 1.1.1
--Subsection 1.1.2
--Subsection 1.1.3
-Section 1.2
--Subsection 1.2.1
--Subsection 1.2.2
--Subsection 1.2.3
-Section 1.3
--Subsection 1.3.1
--Subsection 1.3.2
--Subsection 1.3.3
Chapter 2
-Section 2.1
--Subsection 2.1.1
--Subsection 2.1.2
--Subsection 2.1.3
-Section 2.2
--Subsection 2.2.1
--Subsection 2.2.2
--Subsection 2.2.3
-Section 2.3
--Subsection 2.3.1
--Subsection 2.3.2
--Subsection 2.3.3
Chapter 3
-Section 3.1
--Subsection 3.1.1
--Subsection 3.1.2
--Subsection 3.1.3
-Section 3.2
--Subsection 3.2.1
--Subsection 3.2.2
--Subsection 3.2.3
-Section 3.3
--Subsection 3.3.1
--Subsection 3.3.2
--Subsection 3.3.3
Step by step
Solved in 3 steps with 2 images
could you answer this in Python as well please?