Question from the Python test

Write a Python function that returns the sum of the first n integers.

Hard

What can we say about the function ma_fonction ? (one correct answer)


import decimal
def ma_fonction(nombre_decimal, number):
    """
    Returns nombre_decimal squared, calculated with number significant digits
    """
    with decimal.localcontext() as ctx:
        ctx.prec = number
        return nombre_decimal*nombre_decimal
resultat=ma_fonction(decimal.Decimal('12.121212'),7)
Author: Antoine BrennerStatus: PublishedQuestion passed 1720 times
Edit
0
Community Evaluations
developer avatar
Victor
11/10/2021
Je peux pas voir l'image, elle est mal cadré
developer avatar
Vincent Cotro
18/10/2021
La question a été réécrite en markdown ! Merci.