Share your repls and programming experiences

← Back to all posts
Proportional Fractions Calculator

### Why spend your time writing down numbers...

When you can use this simple program instead?

The goal of this program is to calculate proportions using fractions where the numerator is `x`. This is more of a "solve-for-x" calculator but it works for some proportions as well. Anyways, I really hope you enjoy!

OldWizard209 (285)

`This little piggy tried to defy the basic principles of mathematics and to that end caused global societal and economic decay, causing entire communities to shut down sparking an era of crime and fear. Then, one day, humanity discovered fire once again, having to rebuild from nothing. And that, children, is why you should ALWAYS listen to your math teacher. Good night`

LMAO XD

OldWizard209 (285)

I just found it really funny IDK y @SharpCodeDev

maybe because teachers make it boring and u explained the real reason why its wrong

liltaco (199)

You might want to use the built-in python Fraction library, then you can print an accurate fraction (if, for example, it was 1/3).

https://docs.python.org/3/library/fractions.html

SharpCodeDev (66)

@liltaco LOL I never knew that existed!

SharpCodeDev (66)

@liltaco But sometimes the fractions will be too big, is there a way to simplify/shorten the fractions?

BlakeLeee (15)

Are you able to make a calculator for geometry for rotations about the origin and transitions?

BlakeLeee (15)

@SharpCodeDev Well thanks now that I know that I have a new project for myself!!! Thx man!

BlakeLeee (15)

@SharpCodeDev One question does matplotlib work on repl so I can use a graph?

SharpCodeDev (66)

@BlakeLeee possibly. I haven't used it too much so I wouldn't know.

BlakeLeee (15)

@SharpCodeDev Oh ight well I will definitely show you it when i'm done! You know how to solve rotations about the origin and transitions and stuff right? I hope so because when i'm done I would like you to test it out cya!

SharpCodeDev (66)

### This will be buggy

While this is a test version, all feedback and bug reports are appreciated and should be fixed eventually.

RohilPatel (1457)

Make a nicer error for division by 0; this isn't calculus where you can "do" that!