Skip to main content

Computations on Numbers

Project description

Number Functions

A Python Package of various Number(Integer) Functions for computations

Various Functions and their Description

You can call directly these functions by importing this package

1.quotient(a,b) //It takes two arguments and returns quotient i.e a/b

2.remainder(a,b) //It takes two arguments and returns remainder i.e a%b

3.floordiv(a,b) //It takes two arguments and returns quotient along with specific floor and ceil i.e a//b

4.product(a,b) //It takes two arguments and returns product i.e a * b

5.power(a,b) //It takes two arguments and returns a power b

6.sum(a,b) //It takes two arguments and returns sum i.e a+b

7.subtract(a,b) //It takes two arguments and returns subtraction i.e a-b

8.iseven(n) //It takes one argument and returns true if passed argument is even otherwise false

9.isodd(n) //It takes one argument and returns true if passed argument is odd otherwise false

10.prteven(n) //It takes one argument and prints even digits of that number

11.prtodd(n) //It takes one argument and prints odd digits of that number

12.digcount(n) //It takes one argument and returns the count of digits of given number

13.prtevencount(n) //It takes one argument and prints the count of even digits of given number

14.prtoddcount(n) //It takes one argument and prints the count of odd digits of given number

15.evensum(n) //It takes one argument and returns the sum of even digits of given number

16.oddsum(n) //It takes one argument and returns the sum of odd digits of given number

17.digitsum(n) //It takes one argument and returns the sum of all digits of given number

18.isprime(n) //It takes one argument and returns true if passed argument is prime number otherwise false

19.primedigitcount(n) //It takes one argument and returns count of prime digits in given number

20.prtprime(n) //It takes one argument and prints the prime digits of given number

21.primedigitsum(n) //It takes one argument and returns sum of prime digits of given number

22.digreverse(n) //It takes one argument and returns the number which is reverse of given number

23.ispalindrome(n) //It takes one argument and returns true if passed argument is palindrome otherwise false

24.factorial(n) //It takes one argument and returns factorial of given number

25.factor(n) //It takes one argument and returns factors of given number

26.factorcount(n) //It takes one argument and returns count of factors of given number

27.factorsum(n) //It takes one argument and returns sum of factors of given number

28.isstrong(n) //It takes one argument and returns true if passed argument is strong otherwise false

STRONG:

If sum of individual digits factorial is equal to given number then it is called Strong number Ex:-

145

29.isperfect(n) //It takes one argument and return true if passed argument is perfect otherwise false

PERFECT:

If sum of factors of given number except that one which is equal to given number is called Perfect number Ex:-

28

30.isarmstrong(n) //It takes one argument and return true if passed argument is armstrong otherwise false

ARMSTRONG:

An armstrong number is a number which equal to the sum of the cubes of its individual digits Ex:

153

31.digitproduct(n) //It returns product of digits of given number(number should not contains zeroes(0))

Usage

Following query on terminal will provide the following

INPUT:
-----------------------------------------------
import Numfunctions
a=Num-functions.isprime(407)
print (a)

b=Numfunctions.isodd(51432)
print(b)

c=Numfunctions.digreverse(995186)
print(c)

Numfunctions.prteven(123456789)

Numfunctions.prtprime(123456789123456789)

OUTPUT:
----------------------------------------------
False
False
681599
2 4 6 8
2 3 5 7 2 3 5 7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NumFunc-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

NumFunc-1.0.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file NumFunc-1.0.0.tar.gz.

File metadata

  • Download URL: NumFunc-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for NumFunc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d7e1f694fe46e8ca49ed44a6331986ae089c4e951f9112b9d013f16a12d021d0
MD5 5a6da0efec0d6590121a69d788373d99
BLAKE2b-256 a106eab65db5140582e30ca99d9b16a331c0e3e5a558cadf83f46c78bf451c2a

See more details on using hashes here.

Provenance

File details

Details for the file NumFunc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: NumFunc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for NumFunc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42c0ee97539077ffb1c60996a635259d8bc6f9f82eab6f477e94de95c27d4769
MD5 405b5e8c252e5516486a06285fcf372f
BLAKE2b-256 516863ed7484dff1a612b2ea783a5990de28c16a1d9c062113f32fbac19962a1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page