From 0a956e8500097e4b8d9995ae3f3ee30338c3435e Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Sun, 18 Jun 2023 14:52:56 +0300 Subject: [PATCH] Changed the get_memory check for number. --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 7cdde79..c1d0cbb 100644 --- a/main.py +++ b/main.py @@ -5,7 +5,7 @@ def get_memory(variable_name: str) -> list[bool]: while True: input_chars: list[str] = list(input(f"Enter {variable_name}: ")) - if all(character.isnumeric() and (character == "1" or character == "0") for character in input_chars): + if all(character in ["0", "1"] for character in input_chars): return [True if character == "1" else False for character in input_chars] else: print(f"[ERROR] The {variable_name} may contain only 1-s and 0-s!") @@ -16,8 +16,8 @@ if __name__ == '__main__': print(reg) - print(reg.left_shift(3)) + print(reg.left_shift()) print(reg) - print(reg.right_shift(3)) + print(reg.right_shift()) print(reg)