Sujet : Re: arrondir une réponse
De : yves (at) *nospam* free.invalid (yves)
Groupes : fr.comp.lang.pythonDate : 26. Apr 2022, 17:44:52
Autres entêtes
Organisation : Guest of ProXad - France
Message-ID : <62681374$0$18734$426a74cc@news.free.fr>
References : 1
User-Agent : Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2)
Le Tue, 26 Apr 2022 09:18:19 -0500, Cyrnea a écrit:
Bonjour,
Comment arrondir une réponse arrondie ( au choix ) lorsqu'on a une
réponse obtenue à l'aide d'une fonction ?
ex: écart-type obtenu = 0,9654485745112...
J'obtiens pour erreur " fonction : 2 arguments seulement ".
Ta question est un peu sibylline.
Quelle est cette fonction dont tu parles ?
Qui l'a codée ? toi-même ?
Sinon, pour arrondir, la fonction dans python s'appelle "round".
help(round)
Help on built-in function round in module builtins:
round(...)
round(number[, ndigits]) -> number
Round a number to a given precision in decimal digits (default 0
digits).
This returns an int when called with one argument, otherwise the
same type as the number. ndigits may be negative.
@+
-- Yves