Bernard
unread,Oct 26, 2009, 8:51:23 PM10/26/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tinypy
tinypy complains about "Exception: tp_mod(unknown "%s",yield)" while
running the following code but CPython runs successfully. Any ideas?
def fibonacci():
"""a generator for Fibonacci numbers, goes to next number in
series on each call"""
a, b = 0, 1
while True:
yield a
a, b = b, a + b
def main():
f = fibonacci()
for x in range(13):
print f.next(), # 0 1 1 2 3 5 8 13 21 34 55 89 144
if __name__ == '__main__':
main()