Skip to content

Instantly share code, notes, and snippets.

@sxslex
Created August 6, 2015 14:19
Show Gist options
  • Save sxslex/dc97df45465ae639d0ac to your computer and use it in GitHub Desktop.
Save sxslex/dc97df45465ae639d0ac to your computer and use it in GitHub Desktop.
# -*- coding: UTF-8 -*-
# by slex@slex.com.br
# =)
def infinity():
# Ao infinito e alem ...
i = 0
while True:
i += 1
yield i
def logica_dilma(meta=None):
# NÓS NÃO VAMOS COLOCAR UMA META,
del meta
# VAMOS DEIXAR A META EM ABERTO.
meta = infinity()
for valor in infinity():
# QUANDO A GENTE ATINGIR A META,
if valor == meta:
# AÍ NÓS DOBRAMOS A META!
meta = meta * 2
print valor
if __name__ == '__main__':
logica_dilma()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment