Last active
June 16, 2020 23:54
-
-
Save soupglasses/dd7db05630e466847dbde86f6f38613e to your computer and use it in GitHub Desktop.
Challenge: Print baby shark with less than 300 characters of code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def baby_shark_lyrics(): | |
a,o=[],'' | |
for s in 'Baby Mommy Daddy Grandma Grandpa'.split(): | |
a+=[s+" shark"] | |
a+=["Let's go hunt"] | |
for i in a: | |
o+=(i+","+" doo"*6+"\n")*3+i+"!\n" | |
return o+'Run away,…' | |
print(baby_shark_lyrics()) |
Fun fact. The size of the script is only ~30% of the actual lyrics.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
End output looks like this: