Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner: direct solution in Clear category for Fibonacci Poem by przemyslaw.daniel
def fibo_poem(text: str) -> str:
text, a, b, result = text.split()[::-1], 1, 1 , ""
while text:
line = (text and text.pop() or "_" for _ in range(b))
a, b, result = a + b, a, result + ' '.join(line) + "\n"
return result.strip()
Jan. 6, 2023
Comments: