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
Your top-rated shield against malware and online scams | Avast Free Antivirus Icon
Your top-rated shield against malware and online scams | Avast Free Antivirus

Browse and email in peace, supported by clever AI

Our antivirus software scans for security and performance issues and helps you to fix them instantly. It also protects you in real time by analyzing unknown files before they reach your desktop PC or laptop — all for free.
Free Download
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