From 7bf5efb033dd035db6cb930b1b06f55147e32925 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Sun, 2 Mar 2025 23:59:35 +0000 Subject: [PATCH] Add break to prevent else clause execution --- Chapter_09/9-08_privileges.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Chapter_09/9-08_privileges.py b/Chapter_09/9-08_privileges.py index eb63960..4ecc862 100644 --- a/Chapter_09/9-08_privileges.py +++ b/Chapter_09/9-08_privileges.py @@ -38,6 +38,7 @@ class Privileges: if self.privileges: for privilege in self.privileges: print(f" - {privilege}") + break else: print(" - This user has no privileges.")