Files
archived-discord-bot/math_utils.py
2018-04-03 02:00:56 +05:00

10 lines
280 B
Python

def limit_int(amount: int, high: int, low: int = 1) -> int:
"""
Limits an integer.
:param amount: amount
:param high: high limit
:param low: low limit
:return: limited integer
"""
return low if amount < low else (high if amount > high else amount)