Skip to content

Commit a3bb8aa

Browse files
committed
Relax input validation for operating systems.
1 parent 6cde91d commit a3bb8aa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

prep exercises/Enums exercise.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import sys
55

66
class OperatingSystem(Enum):
7-
MACOS = "macOS"
8-
ARCH = "Arch Linux"
9-
UBUNTU = "Ubuntu"
7+
MACOS = "macos"
8+
ARCH = "arch linux"
9+
UBUNTU = "ubuntu"
1010

1111
@dataclass(frozen=True)
1212
class Person:
@@ -67,7 +67,7 @@ def get_preferred_operating_system() -> OperatingSystem:
6767
preferred_operating_system_input = input("Your preferred operating system (macOS, Ubuntu or Arch Linux): ")
6868

6969
try:
70-
normalised_value = preferred_operating_system_input.strip()
70+
normalised_value = preferred_operating_system_input.strip().lower()
7171
operating_system = OperatingSystem(normalised_value)
7272
return operating_system
7373
except ValueError:

0 commit comments

Comments
 (0)