Skip to content
my_first_calculator.py
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes :neckbeard: Added .gitattributes & .gitignore files May 5, 2016
.gitignore :neckbeard: Added .gitattributes & .gitignore files May 5, 2016
README.md
generator.py fix num_of_ifs calculation May 14, 2016
my_first_calculator.py Fixed 0/0 being Inf not undefined May 10, 2016
my_first_calculator_0_to_1000.rar Updated the archived 0 to 100 May 15, 2016
setup.py Add setup.py May 7, 2016

README.md

my_first_calculator.py

I initially saw Al Sweigart's my_first_tic_tac_toe and was amused. I then saw the image shown below posted on Reddit. Assuming that the image was not made up for some fake internet points and also assuming that their friend only used addition, subtraction, multiplication and division then the number of numbers that they would have if statements for would be...

sqrt(9500/4) = 48.7339...
sqrt(9500/4) ≈ 50 

So to be true to the "real" story I have only gone from 0-50 however higher numbers can easily be generated too however my Python crashes with larger numbers. I generated one that was 0-1000 and it took up 317 MB of space on my hard drive but was only 20MB after I compressed it to a .rar so I have also attached it.

The generator will not work in Python 2 however it can probably be patched to work by doing from __future__ import division

The image

You can’t perform that action at this time.