From 9118bb16a9019ba2e570fa6dddf10c958f32ae1a Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Sun, 18 Jun 2023 15:02:29 +0300 Subject: [PATCH] Simplified the __str__ method. --- BasicRegister.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BasicRegister.py b/BasicRegister.py index 044c51a..9e4801e 100644 --- a/BasicRegister.py +++ b/BasicRegister.py @@ -6,7 +6,7 @@ class BasicRegister: self.memory: list[bool] = memory def __str__(self) -> str: - return f"Memory: [{', '.join([str(int(value)) for value in self.memory])}]" + return f"Memory: {[int(value) for value in self.memory]}" def reverse(self): self.memory = [not value for value in self.memory]