Skip to content

Instantly share code, notes, and snippets.

@bryanwoods
Forked from jameynakama/howmanylives.py
Created August 6, 2011 16:28
Show Gist options
  • Save bryanwoods/1129482 to your computer and use it in GitHub Desktop.
Save bryanwoods/1129482 to your computer and use it in GitHub Desktop.
How many lives does it take for a skydiver to die on the first leap?
from random import *
def die_on_first_jump():
lives = 0
while True:
lives += 1
if lives % 100 is 0:
print "Life #%d..." % lives
if randrange(100000) is 1:
print "It took you %d lives to die on the first jump" % lives
break
die_on_first_jump()
'''
Life #100...
Life #200...
Life #300...
Life #400...
Life #500...
Life #600...
Life #700...
Life #800...
Life #900...
Life #1000...
Life #1100...
Life #1200...
Life #1300...
Life #1400...
Life #1500...
Life #1600...
Life #1700...
Life #1800...
Life #1900...
Life #2000...
Life #2100...
Life #2200...
Life #2300...
Life #2400...
Life #2500...
Life #2600...
Life #2700...
Life #2800...
Life #2900...
Life #3000...
Life #3100...
Life #3200...
Life #3300...
Life #3400...
Life #3500...
Life #3600...
Life #3700...
Life #3800...
Life #3900...
Life #4000...
Life #4100...
Life #4200...
Life #4300...
Life #4400...
Life #4500...
Life #4600...
Life #4700...
Life #4800...
Life #4900...
Life #5000...
Life #5100...
Life #5200...
Life #5300...
Life #5400...
Life #5500...
Life #5600...
Life #5700...
Life #5800...
Life #5900...
Life #6000...
Life #6100...
Life #6200...
Life #6300...
Life #6400...
Life #6500...
Life #6600...
Life #6700...
Life #6800...
Life #6900...
Life #7000...
Life #7100...
Life #7200...
Life #7300...
Life #7400...
Life #7500...
Life #7600...
Life #7700...
Life #7800...
Life #7900...
Life #8000...
Life #8100...
Life #8200...
Life #8300...
Life #8400...
Life #8500...
Life #8600...
Life #8700...
Life #8800...
Life #8900...
Life #9000...
Life #9100...
Life #9200...
Life #9300...
Life #9400...
Life #9500...
Life #9600...
Life #9700...
Life #9800...
Life #9900...
Life #10000...
Life #10100...
Life #10200...
Life #10300...
Life #10400...
Life #10500...
Life #10600...
Life #10700...
Life #10800...
Life #10900...
Life #11000...
Life #11100...
Life #11200...
Life #11300...
Life #11400...
Life #11500...
Life #11600...
Life #11700...
Life #11800...
Life #11900...
Life #12000...
Life #12100...
Life #12200...
Life #12300...
Life #12400...
Life #12500...
Life #12600...
Life #12700...
Life #12800...
Life #12900...
Life #13000...
Life #13100...
Life #13200...
Life #13300...
Life #13400...
Life #13500...
Life #13600...
Life #13700...
Life #13800...
Life #13900...
Life #14000...
Life #14100...
Life #14200...
Life #14300...
Life #14400...
Life #14500...
Life #14600...
Life #14700...
Life #14800...
Life #14900...
Life #15000...
Life #15100...
Life #15200...
Life #15300...
Life #15400...
Life #15500...
Life #15600...
Life #15700...
Life #15800...
Life #15900...
Life #16000...
Life #16100...
Life #16200...
Life #16300...
Life #16400...
Life #16500...
Life #16600...
Life #16700...
Life #16800...
Life #16900...
Life #17000...
Life #17100...
Life #17200...
Life #17300...
Life #17400...
Life #17500...
Life #17600...
Life #17700...
Life #17800...
Life #17900...
Life #18000...
Life #18100...
Life #18200...
Life #18300...
Life #18400...
Life #18500...
Life #18600...
Life #18700...
Life #18800...
Life #18900...
Life #19000...
Life #19100...
Life #19200...
Life #19300...
Life #19400...
Life #19500...
Life #19600...
Life #19700...
Life #19800...
Life #19900...
Life #20000...
Life #20100...
Life #20200...
Life #20300...
Life #20400...
Life #20500...
Life #20600...
Life #20700...
Life #20800...
Life #20900...
Life #21000...
Life #21100...
Life #21200...
Life #21300...
Life #21400...
Life #21500...
Life #21600...
Life #21700...
Life #21800...
Life #21900...
Life #22000...
Life #22100...
Life #22200...
Life #22300...
Life #22400...
Life #22500...
Life #22600...
Life #22700...
Life #22800...
Life #22900...
Life #23000...
Life #23100...
Life #23200...
Life #23300...
Life #23400...
Life #23500...
Life #23600...
Life #23700...
Life #23800...
Life #23900...
Life #24000...
Life #24100...
Life #24200...
Life #24300...
Life #24400...
Life #24500...
Life #24600...
Life #24700...
Life #24800...
Life #24900...
Life #25000...
Life #25100...
Life #25200...
Life #25300...
Life #25400...
Life #25500...
Life #25600...
Life #25700...
Life #25800...
Life #25900...
Life #26000...
Life #26100...
Life #26200...
Life #26300...
Life #26400...
Life #26500...
Life #26600...
Life #26700...
Life #26800...
Life #26900...
Life #27000...
Life #27100...
Life #27200...
Life #27300...
Life #27400...
Life #27500...
Life #27600...
Life #27700...
Life #27800...
Life #27900...
Life #28000...
Life #28100...
Life #28200...
Life #28300...
Life #28400...
Life #28500...
Life #28600...
Life #28700...
Life #28800...
Life #28900...
Life #29000...
Life #29100...
Life #29200...
Life #29300...
Life #29400...
Life #29500...
Life #29600...
Life #29700...
Life #29800...
Life #29900...
Life #30000...
Life #30100...
Life #30200...
Life #30300...
Life #30400...
Life #30500...
Life #30600...
Life #30700...
Life #30800...
Life #30900...
Life #31000...
Life #31100...
Life #31200...
Life #31300...
Life #31400...
Life #31500...
Life #31600...
Life #31700...
Life #31800...
Life #31900...
Life #32000...
Life #32100...
Life #32200...
Life #32300...
Life #32400...
Life #32500...
Life #32600...
Life #32700...
Life #32800...
Life #32900...
Life #33000...
Life #33100...
Life #33200...
Life #33300...
Life #33400...
Life #33500...
Life #33600...
Life #33700...
Life #33800...
Life #33900...
Life #34000...
Life #34100...
Life #34200...
Life #34300...
Life #34400...
Life #34500...
Life #34600...
Life #34700...
Life #34800...
Life #34900...
Life #35000...
Life #35100...
Life #35200...
Life #35300...
Life #35400...
Life #35500...
Life #35600...
Life #35700...
Life #35800...
Life #35900...
Life #36000...
Life #36100...
Life #36200...
Life #36300...
Life #36400...
Life #36500...
Life #36600...
Life #36700...
Life #36800...
Life #36900...
Life #37000...
Life #37100...
Life #37200...
Life #37300...
Life #37400...
Life #37500...
Life #37600...
Life #37700...
Life #37800...
Life #37900...
Life #38000...
Life #38100...
Life #38200...
Life #38300...
Life #38400...
Life #38500...
Life #38600...
Life #38700...
Life #38800...
Life #38900...
Life #39000...
Life #39100...
Life #39200...
Life #39300...
Life #39400...
Life #39500...
Life #39600...
Life #39700...
Life #39800...
Life #39900...
Life #40000...
Life #40100...
Life #40200...
Life #40300...
Life #40400...
Life #40500...
Life #40600...
Life #40700...
Life #40800...
Life #40900...
Life #41000...
Life #41100...
Life #41200...
Life #41300...
Life #41400...
Life #41500...
Life #41600...
Life #41700...
Life #41800...
Life #41900...
Life #42000...
Life #42100...
Life #42200...
Life #42300...
Life #42400...
Life #42500...
Life #42600...
Life #42700...
Life #42800...
Life #42900...
Life #43000...
Life #43100...
Life #43200...
Life #43300...
Life #43400...
Life #43500...
Life #43600...
Life #43700...
Life #43800...
Life #43900...
Life #44000...
Life #44100...
Life #44200...
Life #44300...
Life #44400...
Life #44500...
Life #44600...
Life #44700...
Life #44800...
Life #44900...
Life #45000...
Life #45100...
Life #45200...
Life #45300...
Life #45400...
Life #45500...
Life #45600...
Life #45700...
Life #45800...
Life #45900...
Life #46000...
Life #46100...
Life #46200...
Life #46300...
Life #46400...
Life #46500...
Life #46600...
Life #46700...
Life #46800...
Life #46900...
Life #47000...
Life #47100...
Life #47200...
Life #47300...
Life #47400...
Life #47500...
Life #47600...
Life #47700...
Life #47800...
Life #47900...
Life #48000...
Life #48100...
Life #48200...
Life #48300...
Life #48400...
Life #48500...
Life #48600...
Life #48700...
Life #48800...
Life #48900...
Life #49000...
Life #49100...
Life #49200...
Life #49300...
Life #49400...
Life #49500...
Life #49600...
Life #49700...
Life #49800...
Life #49900...
Life #50000...
Life #50100...
Life #50200...
Life #50300...
Life #50400...
Life #50500...
Life #50600...
Life #50700...
Life #50800...
Life #50900...
Life #51000...
Life #51100...
Life #51200...
Life #51300...
Life #51400...
Life #51500...
Life #51600...
Life #51700...
Life #51800...
Life #51900...
Life #52000...
Life #52100...
Life #52200...
Life #52300...
Life #52400...
Life #52500...
Life #52600...
Life #52700...
Life #52800...
Life #52900...
Life #53000...
Life #53100...
Life #53200...
Life #53300...
Life #53400...
Life #53500...
Life #53600...
Life #53700...
Life #53800...
Life #53900...
Life #54000...
Life #54100...
Life #54200...
Life #54300...
Life #54400...
Life #54500...
Life #54600...
Life #54700...
Life #54800...
Life #54900...
Life #55000...
Life #55100...
Life #55200...
Life #55300...
Life #55400...
Life #55500...
Life #55600...
Life #55700...
Life #55800...
Life #55900...
Life #56000...
Life #56100...
Life #56200...
Life #56300...
Life #56400...
Life #56500...
Life #56600...
Life #56700...
Life #56800...
Life #56900...
Life #57000...
Life #57100...
Life #57200...
Life #57300...
Life #57400...
Life #57500...
Life #57600...
Life #57700...
Life #57800...
Life #57900...
Life #58000...
Life #58100...
Life #58200...
Life #58300...
Life #58400...
Life #58500...
Life #58600...
Life #58700...
Life #58800...
Life #58900...
Life #59000...
Life #59100...
Life #59200...
Life #59300...
Life #59400...
Life #59500...
Life #59600...
Life #59700...
Life #59800...
Life #59900...
Life #60000...
Life #60100...
Life #60200...
Life #60300...
Life #60400...
Life #60500...
Life #60600...
Life #60700...
Life #60800...
Life #60900...
Life #61000...
Life #61100...
Life #61200...
Life #61300...
Life #61400...
Life #61500...
Life #61600...
Life #61700...
Life #61800...
Life #61900...
Life #62000...
Life #62100...
Life #62200...
It took you 62270 lives to die on the first jump
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment