#!/usr/bin/python # TYPE:sciencemath # DESC:Calculates the amount of years it would take a mole of moles to reproduce enough times (population doubling every month) so the mass of the moles equals the mass of the known universe. # mass of mole and universe in grams massMole = 100 massUniverse = 3e+55 # number of moles to start off with numberMoles = 6.02e+23 # conversion factor month2year = 1/12.0 # we start with one month months = 0 while numberMoles * massMole <= massUniverse: numberMoles *= 2 months += 1 print "%d: %s" % (months, str(numberMoles * massMole)) print "Months: %d" % months print "Years: %4f" % (months * month2year) print "Mass: %s" % str(numberMoles * massMole)