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 1986 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!