Любослав обнови решението на 31.03.2015 13:00 (преди над 9 години)
+def fibonacci():
+ first = 1;
+ second = 1;
+
+ while True:
+ yield first
+ first, second = second, first
+ second += first
+
+
+
+def primes():
+ def is_prime(num):
+ for i in range(2, num - 1):
+ if num % i == 0:
+ return False
+ return True
+
+ i = 1
+ while True:
+ i += 1
+ if is_prime(i):
+ yield i