Whose calculator looks like this?
>>> (131 + 21.5 + 100.2 + 88.7 + 99.5 + 100.5 + 200.5)/4 185.475
Python 3 is my favorite calculator (not Python 2 because 1/2 = 0)
Beyond basic operations:
Develop your own functions: unit conversion, finding correlation, .., anything really
Use PYTHONSTARTUP to extend the battery of readily available mathematical functions
$ PYTHONSTARTUP=~/work/dmwp/pycon-us-2016/startup_math.py idle3 -s
>>> unit_conversion() 1. Kilometers to Miles 2. Miles to Kilometers 3. Kilograms to Pounds 4. Pounds to Kilograms 5. Celsius to Fahrenheit 6. Fahrenheit to Celsius Which conversion would you like to do? 6 Enter temperature in fahrenheit: 98 Temperature in celsius: 36.66666666666667 >>>
# Create graphs from algebraic expressions from sympy import Symbol, plot x = Symbol('x') p = plot(2*x**2 + 2*x + 2)
# Solve equations from sympy import solve, Symbol x = Symbol('x') solve(2*x + 1)
# Limits from sympy import Symbol, Limit, sin x = Symbol('x') Limit(sin(x)/x, x, 0).doit()
# Derivative from sympy import Symbol, Derivative, sin, init_printing x = Symbol('x') init_printing() Derivative(sin(x)**(2*x+1), x).doit()
# Indefinite integral from sympy import Symbol, Integral, sqrt, sin, init_printing x = Symbol('x') init_printing() Integral(sqrt(x)).doit()
# Definite integral from sympy import Symbol, Integral, sqrt x = Symbol('x') Integral(sqrt(x), (x, 0, 2)).doit()
from IPython.display import YouTubeVideo YouTubeVideo("8uWRVh58KdQ")
Outstanding guide to using Python to do maths. Working back through my undergrad maths using Python.
Saha does an excellent job providing a clear link between Python and upper-level math concepts, and demonstrates how Python can be transformed into a mathematical stage.
This book is highly recommended for the high school or college student and anyone who is looking for a more natural way of programming math and scientific functions
As a teacher I highly recommend this book as a way to work with someone in learning both math and programming
Thanks to PyCon US for reduced registration rates
Massive thanks to my employer, Freelancer.com for sponsoring my travel and stay