On Thu, 3 Dec 2020 at 18:26, Ernesto Arbitrio <[email protected]> wrote:
> potresti usare qualcosa del tipo:
> print("{0}".format(str(round(x, 1) if x % 1 else int(x)))
>
Oppure:
>>> f"{6:g}"
'6'
>>> f"{6.0:g}"
'6'
>>> f"{6.5:g}"
'6.5'
Ciao.
Marco.
_______________________________________________ Python mailing list [email protected] https://lists.python.it/mailman/listinfo/python
