logo

Crowdly

On considère le code Python suivant : def reverse_str(initial_string):     ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

On considère le code Python suivant :

def reverse_str(initial_string):

    final_string = ''

    index = len(initial_string)

    while index > 0:

        final_string += initial_string[index - 2]

        index = index - 1

    return final_string

On considère la fonction de test suivante :

from source import reverse_str

def test_should_reverse_string():

    assert reverse_str('abc') == 'cba'

Quel framework de test unitaire Python allez-vous utiliser ? Indiquez la ligne de commandes à utiliser.

Quelle erreur relevez vous dans le code ? Proposez la(es) correction(s) qui s'impose(nt) le cas échéant.

More questions like this

Want instant access to all verified answers on moodle.univ-artois.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!