max

max

> Funzioni

Restituisce il valore più grande tra i due numeri a* e *b.

Impostazioni
Feedback
Python

In Python, max() è la funzione nativa del linguaggio: accetta quanti argomenti si vuole (max(a, b, c)) oppure un singolo iterabile (max([1, 2, 3])), e confronta qualsiasi tipo ordinabile — numeri, stringhe o oggetti di una classe che definisce __lt__.

Esempi

max(2, 5) // 5 max(-2, -5) // -2

Vedi pure