The goal of this project is to expand the functionality of the Python 3.x standard library Fraction class to accept anything that Fraction would and more: Mixed('3 4/5') == Mixed(3,4,5) == Mixed(Fraction(19,5)) etc (see examples section in the source for full list). This class is designed to behave exactly as a standard Fraction would except that 1) it supports string constructions of mixed number fractions, 2) it supports three argument construction in the form of whole_number,numerator, denominator, and 3) the string representation is formatted in mixed number form. All the methods and properties behave the same (except as noted above) with the addition of a fnumerator property which returns the numerator of the fractional portion of the number only and the addition of a whole property which behaves as a % 1 to return only the whole number portion of the number. Why? I wanted it. Python didn't have it. So I wrote it.

Project Activity

See All Activity >

Follow Python Mixed Fractions Class

Python Mixed Fractions Class Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Python Mixed Fractions Class!

Additional Project Details

Registered

2013-11-16