acelewis / my_first_calculator.py Goto Github PK
View Code? Open in Web Editor NEWmy_first_calculator.py
my_first_calculator.py
I have no rar uncompresser in my stdlib
You actually computed all of those by hand instead of programming it?
My stomach hurts laughing at this honestly. I love it.
Probably parse the string to an integer..
Like
(2 * 6) + 9
We really need this
please have my children
I'd love to see this in some other languages, as it's highly useful. COBOL comes to mind, or maybe R
If not, you are hero of the year 2016!
Due to some earlier feature requests, we could also write a generator for the generator to support numbers like 51, just by generating the generator with dynamic min an max values.
We could generate every new feature request a user could have ๐
Your code is great but could you make it a bit shorter. You can add methods with parameters 'sign', 'num1' and 'num2'
def add(num1 = None, num2 = None):
answer = num1 + num2
print(answer) # You can also do 'return answer'
Put a calculator in a function to call this function again when the code ends
Please add these
Yeah... I think thats the main issue xD
Please, add support for 99, i dont know much its 99+1 :(
You exit from positive IF and continue check others IF's. This is unnecessary.
You need to use RETURN in every IF statement. Will be huge performance jump.
if num1 == 5 and sign == '/' and num2 == 11:
print("5/11 = 0.45454545454545453")
5/11 shouldn't have 3 as its last digit.
Rather end with a 5. Also precision seems to vary. ;)
Nice
I really want to use this calculator but I need 51 support
Linux kernel < my_first_calculator.py
gave me cancer...
https://github.com/starinfinity/my_first_calculator-creator
I have created the file for support till 100 and can be increased. Visit the above link.
u crashed my browser ;(
Thank you for very useful calculator. Could you extend range of this calculator? -2147000000000...2147000000000 looks like good.
Thank you!
Fiverr , Freelancer - Can you code ? Yes, can , 100% to your satisfaction. We are a team of IT professionals , good portfolio , promise you will meet your standard.
Please pay first, don't worry, we experienced.
This really reminds me of hiring from Fiverr, Freelancer, Upwork when it comes to users with low/mid reviews. Don't be surprised to find such code standard from top "reviewers".
I never saw someone more stupid than you,
This is slow! ๐
Really nice calculator! We try use it in entreprise project but we need bigInt. Please add it.
worst thing i have ever seen in my life. Please fix it.
As discussed here, and other seminal computer science works : https://dl.acm.org/citation.cfm?id=586091
Performing branch reordering would re-arrange the control statements such that the most likely calculator results are tested first, saving unnecessary tests. To do this properly, one would need to profile usage of this software among many users to obtain a statistically represented pattern of common mathematical operations.
Alternatively, in the absence of runtime profiling, one could make educated guesses that certain patterns are more likely. It can be argued that more users are aware of positive numbers than negative numbers, so those control flow tests should be hoisted lower in the branching logic.
Another possibility is we implement a JIT that does runtime-level branch reordering based on observed test frequency. Such a contribution would be welcome at @numba.
We revoke your license to programming
When is the next version going to be released?
I propose to create Code of Conduct for this project.
There is need for lot of developers here until we
reach short int
The title said it all.
i was dum
Good meme
Consider this. 0xC = 0
. Any C except for infinity will satisfy this equation.
The result of 0/0
should be Undefined
.
You are awesome brother!!
I really do
You are missing unit tests. You should cover the code with tests.
I mean for my_first_calculator.py itself of course.
This is a perfect example of writing clean, easy to read, and refactored code.
When people ask me "How do I learn how to code", I'll be sending them here!
Why are you doing it???
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.