Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
def gen_hexagonal():
    n = 1
    while True:
        yield (2 * n * (2 * n - 1)) // 2
        n += 1



for i, num in zip(range(50), gen_hexagonal()):
    print(num)