Skip to content

Commit eec6b69

Browse files
committed
Making avaiable OS options available to end-user for better UX experince
1 parent be69676 commit eec6b69

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

prep-exercises/exercise_eleven.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class Laptop:
5555
]
5656

5757

58-
name_input = input("What's your name? ")
58+
name_input = input("Enter your name: ")
5959
if not name_input.isalpha():
6060
print("Name must contain letters only!")
6161
sys.exit(1)
6262

6363
try:
64-
age_input = int(input("What's your age? "))
64+
age_input = int(input("Enter your age: "))
6565
except ValueError:
6666
print("Enter a numeric value for the age!")
6767
sys.exit(1)
@@ -76,7 +76,8 @@ def parse_os_input(user_input: str) -> operatingSystem:
7676
print("Invalid operating system!", file=sys.stderr)
7777
sys.exit(1)
7878

79-
preferred_operating_system_input = parse_os_input(input("What's your preferred operating system? "))
79+
options = ", ".join(os.value for os in operatingSystem)
80+
preferred_operating_system_input = parse_os_input(input(f"Enter your preferred operating system (Select from: {options}) "))
8081

8182

8283

0 commit comments

Comments
 (0)