bibimbap as i make it is basically
- rice
- sitr fried vegetables
- some meat in tasty spices
- gochujang (this is fermented soy bean paste with paprika)
- a fried egg
| import collections | |
| def flatten(input): | |
| stack = list(reversed(input)) | |
| while stack: | |
| top = stack.pop() | |
| if isinstance(top, collections.Iterable): | |
| stack.extend(list(reversed(top))) | |
| else: | |
| yield top |
| import collections | |
| def flatten(input, seen=None): | |
| for item in input: | |
| if isinstance(item, collections.Iterable): | |
| for sub in flatten(item): | |
| yield sub | |
| else: | |
| yield item |
| def flatten(source): | |
| stack = source[::-1] | |
| while stack: | |
| top = stack.pop() | |
| if hasattr(top, '__iter__'): | |
| stack.extend(reversed(top)) | |
| else: | |
| yield top | |
| print list(flatten([1,[2,3,[4,5,[6],7],8,[9,[10,11],[12],[[13]],[[[14,15]]],16]]])) |
| import collections | |
| import itertools | |
| def flattened(i): | |
| i = iter(i) | |
| while True: | |
| first = i.next() | |
| if isinstance(first, collections.Iterable): | |
| i = itertools.chain(first, i) | |
| else: |
| # coding=utf-8 | |
| import sys | |
| normal = u' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~' | |
| wide = u' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!゛#$%&()*+、ー。/:;〈=〉?@[\\]^_‘{|}~' | |
| widemap = dict((ord(n), w) for n,w in zip(normal, wide)) | |
| while True: | |
| line = sys.stdin.readline() | |
| if not line: |
| # Python or Ruby | |
| l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10)),'l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10))','print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q)))' | |
| print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q))) |
| from turtle import * | |
| def curve(depth, length, angle): | |
| if depth == 0: | |
| if angle > 0: | |
| pencolor('green') | |
| else: | |
| pencolor('blue') | |
| forward(length) |
- Z A
- Y B
- X C
-
- W D
-
- V E
-
- U F