mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-09-07 20:20:39 +02:00
15 lines
290 B
Python
15 lines
290 B
Python
class PowerOfTwo:
|
|
def __init__(self, exp) -> None:
|
|
self.exp = exp
|
|
|
|
def __call__(self) -> int:
|
|
result: int = 2**self.exp
|
|
self.exp += 1
|
|
return result
|
|
|
|
|
|
if __name__ == "__main__":
|
|
power = PowerOfTwo(1)
|
|
for _ in range(10):
|
|
print(power())
|