Created
November 29, 2016 15:17
-
-
Save masahitojp/12cb69d1e4feada65f964a6e485fee67 to your computer and use it in GitHub Desktop.
ppap with Python3.5(http://qiita.com/foooomio/items/969a8ff1178c80ec529f)
This file contains hidden or 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
$ python3 ppap.py | |
πββππβππππββπββββπββππβββπββππβPen Pineapple Apple Pen |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import random | |
PPAP = ['\N{Black Nib}', '\N{PINEAPPLE}', '\N{RED APPLE}', '\N{Black Nib}'] | |
ppap = [] | |
def tap(x, f): | |
f(x) | |
return x | |
while ppap[-4:] != PPAP: | |
ppap.append(tap(random.choice(PPAP), lambda x: print(x, end=''))) | |
print("Pen Pineapple Apple Pen") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment