Skip to content

Final-PythonFoundationHomework/class_number_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Assignment for Object Oriented Programming

Create a class "Number"

Attributes:

  • number (integer)

Methods:

  • __init__ (constructor)
  • get_number (returns the number)
  • is_even (returns True if the number is even, False otherwise)
  • is_odd (returns True if the number is odd, False otherwise)
  • is_prime (returns True if the number is prime, False otherwise)
  • get_divisors (returns a list of all divisors of the number)
  • get_length (returns the number of digits of the number)
  • get_sum (returns the sum of all digits of the number)
  • get_reverse (returns the number in reverse order)
  • get_digits (returns a list of all digits of the number)
  • get_max (returns the largest digit of the number)
  • get_min (returns the smallest digit of the number)
  • get_average (returns the average of all digits of the number)
  • get_median (returns the median of all digits of the number)
  • get_range (returns the range of all digits of the number)
  • get_frequency (returns a dictionary with the frequency of each digit)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages