Wednesday, July 17, 2013

Some simple numbers.

Here's a simple python app to show integers versus floats.

# python math
# at a terminal prompt, type: python pythonmath.py
# on either the Pi or a Mac.
print "Integer: 9 / 5 is", 9 / 5
print "Float: 9.0 / 5.0 is", 9.0 / 5.0
print "Integer: 2 / 3 is", 2 / 3
print "Float: 2.0 / 3.0 is", 2.0 / 3.0
view raw pythonmath.py hosted with ❤ by GitHub

No comments:

Post a Comment