mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
bla
This commit is contained in:
14
uczelnia/2_semestr/python/laby/9/zad1.py
Normal file
14
uczelnia/2_semestr/python/laby/9/zad1.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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())
|
||||
Reference in New Issue
Block a user