You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 KiB

In [8]:
def katamari(text, separator='hello'):
    things = text.split(separator)
    output = ''
    for thing in things[1:]:
        output = output + f'hello {thing.strip()} '
        print(output)
In [9]:
katamari('hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars hello soundtrack hello marimba hello calimba hello mazinga')
hello moon 
hello moon hello earth 
hello moon hello earth hello rings of saturn 
hello moon hello earth hello rings of saturn hello orbital elements 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars hello soundtrack 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars hello soundtrack hello marimba 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars hello soundtrack hello marimba hello calimba 
hello moon hello earth hello rings of saturn hello orbital elements hello fixed stars hello milky way hello popping stars hello shooting stars hello soundtrack hello marimba hello calimba hello mazinga 
In [10]:
katamari('hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children hello')
hello book 
hello book hello shelves 
hello book hello shelves hello supermarket 
hello book hello shelves hello supermarket hello street 
hello book hello shelves hello supermarket hello street hello car 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children hello  
In [11]:
katamari('hello king hello queen hello prince hello')
hello king 
hello king hello queen 
hello king hello queen hello prince 
hello king hello queen hello prince hello  
In [12]:
katamari('hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice hello nietche hello beach hello whale hello waves')
hello frog 
hello frog hello giraffe 
hello frog hello giraffe hello lipstick 
hello frog hello giraffe hello lipstick hello rubber 
hello frog hello giraffe hello lipstick hello rubber hello beaver 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice hello nietche 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice hello nietche hello beach 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice hello nietche hello beach hello whale 
hello frog hello giraffe hello lipstick hello rubber hello beaver hello flower hello candy hello treasure hello television hello window hello chair hello fire extinguisher hello carpet hello grass hello cigarette hello mouse hello mice hello nietche hello beach hello whale hello waves 
In [13]:
katamari('hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children hello')
hello book 
hello book hello shelves 
hello book hello shelves hello supermarket 
hello book hello shelves hello supermarket hello street 
hello book hello shelves hello supermarket hello street hello car 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children 
hello book hello shelves hello supermarket hello street hello car hello ceo of the city public transportation system hello playstation hello carpet hello giraffe hello frog hello ball hello dust hello microbs hello crown hello corona hello clown hello mine hello mineral hello anti men mine hello gun hello killer hello kinder hello children hello  
In [ ]: