init
This commit is contained in:
18
it_test.py
Normal file
18
it_test.py
Normal file
@@ -0,0 +1,18 @@
|
||||
def iterator():
|
||||
i = 1
|
||||
while True:
|
||||
yield i
|
||||
i = i * 2
|
||||
|
||||
|
||||
def print_binary(num):
|
||||
print(f"Bin: {num:032b}")
|
||||
|
||||
|
||||
run = 1
|
||||
gen = iterator()
|
||||
while run != 0:
|
||||
nextv = next(gen)
|
||||
print(f"Int: {nextv}")
|
||||
print_binary(nextv)
|
||||
run = nextv
|
Reference in New Issue
Block a user