With respect to the Table of Contents - in the US:
https://www.copyright.gov/circs/circ01.pdf
What Is Not Protected by Copyright? Copyright does not protect •
Ideas, procedures, methods, systems, processes, concepts, principles,
or discoveries • Works that are not fixed in a tangible form (such as
a choreographic work that has not been notated or recorded or an
improvisational speech that has not been written down) • Titles,
names, short phrases, and slogans • Familiar symbols or designs • Mere
variations of typographic ornamentation, lettering, or coloring • Mere
listings of ingredients or contents For more information, see Works
Not Protected by Copyright (Circular 33).
In the UK (here) :
Copyright protects only the expression of ideas, not the ideas
themselves. For example, two artists may paint the same scene but
portray them in ways that are slightly different, without infringing
each other’s copyright. At the same time, the fact that the series
Lost is copyright protected does not prevent you from writing a story
about a number of people who are forced to live on a remote island
after a plane crash.
Taking inspiration from someone else’s work is therefore acceptable,
but in order to have copyright in your work and avoid infringement you
need to create something original by using your own skill, labour,
judgement and effort. Using another’s work is copyright infringement
when ‘the work as a whole or any substantial part of it’ has been
copied. Unfortunately, the precise meaning of these concepts is
defined on a case-by-case basis. In deciding cases like this, courts
will weigh the potential impact upon the originator’s ability to
market their work with the concern that other people should be able to
use it in order to draw inspiration for future work.
Now - just to dive a bit further in and have a thought experiment.
Using those titles in your question as your titles, would be fairly anodyne and would likely NOT constitute a breach of copyright as they are merely describing what most study guides have at the beginning of their contents page! Substantial material has not been copied. However - if we engage our law heads and accept that this may not be a criminal issue, but rather a civil tort/wrong that could lead to a law suit if the book owner were to discover your copying of their exact titular layout in order to structure your course. If you made a full course, with say 50 topics that are mapped exactly to the same topics, in the same order - it could be argued by a lawyer that you are stealing someone's creative structuring of a study guide. They would then have to persuade the court that this was the case. You might argue that these topic headings were common to most study programmes for Python and represent fair communal use - see [here][2]. It is also hard to argue 'creativity' and expression in a fairly standard TOC page.
There are exceptions to copyright in some educational circumstances ([here][3]).
I would have said that a simple remedy would be to rename and restructure the titles as much as possible to prevent such a link from being made - thus showing you have put your own effort into constructing your own course outline.
However you have also included "and the main ideas" - this might take us down another road entirely if you mean the main ideas from within the chapters themselves.... see [here][4].
When creating new work, it is natural to be inspired by the work of
others. However, there is an important distinction between simply
being inspired and unlawfully copying. In order not to infringe
someone else’s copyright – meaning that you trespass on or otherwise
interfere with their rights – you need to make sure that your work is
substantially different to the work that inspires you. According to UK
copyright law, your work is considered original – and thus protected
by copyright – if you use your skill, labour, judgement and effort to
create it. Using another’s work is copyright infringement when ‘the
work as a whole or any substantial part of it’ has been copied. The
meaning of ‘substantial’ changes is defined on a case-by-case basis.
Usually the court focuses on the quality of the parts taken, not
necessarily the amount, and the circumstances of each case.
[2]: https://www.bl.uk/business-and-ip-centre/articles/fair-use-copyright-explained#:~:text=The%20concept%20of%20fair%20usage,s)%20or%20infringing%20their%20interest.
[3]: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/375951/Education_and_Teaching.pdf
[4]: https://www.copyrightuser.org/understand/rights-permissions/using-reusing/