-
-
Save livibetter/7299784 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Folding paper in half 50 times is 3/4 of the distance from earth to sun | |
From: | |
http://www.quora.com/What-are-some-of-the-most-mind-blowing-facts#answer_526501 | |
Thickness of a sheet of paper: 0.1 mm (~0.004 inches) | |
""" | |
AU = 149597870700 | |
def fold(num_folds=50, thickness=1E-4): | |
"""Simulate folding a sheet of paper in half. | |
``num_folds`` is the number of times we'll fold the paper in half. | |
``thickness`` is the the thickness of a sheet of paper in meters. | |
""" | |
for i in range(1, num_folds + 1): | |
thickness *= 2 | |
fmt_string = '{n:2} folds, thickness = {thickness:E} m = {au:f} AU' | |
print(fmt_string.format(n=i, thickness=thickness, au=thickness / AU)) | |
def main(): | |
n = int(input("How many folds? ")) | |
fold(n) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will the piece of paper (or should I say block of paper) burn? And it can be heavier than Mercury. I am thinking too much to this 50-fold paper.