.. question::
    :title: Racines du trinome
    :collapse:

    .. index::
        pair: fonction; racines du trinome
        pair: sciences propédeutiques; racines du trinome

    Définir (spécification + implémentation) une fonction qui
    détermine la liste des racines réelles d'un trinôme
    :math:`ax^2 + bx + c` à coefficients réels.

    .. block::
        :title: aide Python

        **Module random**
            Ce module permet de générer des nombres pseudo-aléatoires.

            Exemple::

                import random
                
                n = random.randint(0,100)
                e = random.choice([1,2,3,4,5,6])
                p = random.random()

            **Fonctions :**
                choice, randint, random, randrange, seed, shuffle, uniform
                
            **Documentation officielle :** 
                :ln:`module random <https://docs.python.org/2/library/random.html>`

        **Module math**
            Ce module permet de manipuler les principales fonctions mathématiques.

            Exemple::

                import math
                
                pi = math.pi
                y = math.log(math.sin(math.pi/2))


            **Constantes :**
                pi, e
                
            **Fonctions :**
                acos, acosh, asin, asinh, atan, atan2, atanh, ceil, copysign, cos, cosh, 
                degrees, exp, fabs, factorial, floor, hypot, isnan, log, log10, pow, 
                radians, sin, sinh, sqrt, tan, tanh, trunc
                
            **Documentation officielle :** 
                :ln:`module math <https://docs.python.org/2/library/math.html>`

    .. answer::

        #.  **AAV4_DEF: Résultat**

            Utiliser l'interpréteur Python ci-dessous pour programmer 
            l'algorithme demandé.

            .. code-run:: python
                :title: AAV4_DEF: Résultat

        #.  **AAV4_DEF: Vérification**

            Appliquer cette technique au résultat proposé.

            Si cette technique nécessite d'être implémentée en Python, le
            faire dans l'interpréteur Python ci-dessus (cf. Résultat), 
            sinon développer la technique de vérification dans l'éditeur 
            de texte ci-dessous.

            .. inputlines:: 
                :title: AAV4_DEF: Vérification
                :noheader:

    .. solution::
                        
        #.  **AAV4_DEF: Répondre explicitement à la question posée**

            La définition attendue est présentée dans l'interpréteur 
            ci-dessous.

            .. ifconfig:: modeEnibook == "learning"

                .. code-run:: python
                    :file: ../prg/fonction-prop-4.py

            .. ifconfig:: modeEnibook == "training"

                .. literalinclude:: /prg/fonction-prop-4.py

        #.  **AAV4_DEF: Choisir et appliquer une technique de vérification**

            La vérification par :solution:`jeu de tests` est mise en œuvre :
            la fonction définie précédemment est conforme au jeu de tests.

