Skip to main content

intutils API Reference

intutils is a basic Python integer manipulation library.

days_in_month(month_number, year_int=0)#

Returns the number of days in the given month.

Parameter month_number: int - The month. (required)

Parameter year_int: Optional[int] - The year to check (for leap years). (default: 0)

Returns: int - The day count.

divisible_by_no_decimals(number, divisor)#

Checks if the number can be divided by the divisor without the resulting number having decimals in it.

Parameter number: int - The base number. (required)

Parameter divisor: int - The number to divide the number by. (required)

Returns: bool - If it is possible.

is_even(number)#

Returns if the number is even.

Parameter number: int - The number to check. (required)

Returns: bool - If the number is even.

is_odd(number)#

Returns if the number is odd.

Parameter number: int - The number to check. (required)

Returns: bool - If the number is odd.

sort_greatest_to_least(mylist)#

Sorts the passed list of integers from greatest to least.

Parameter mylist: List[int] - The list to sort. (required)

Returns: List[int] - The sorted list.

Last updated on by Reece Dunham