LogicDecode / hactoberfest2023

Pull request best of your code snippets to help open source community
MIT License
10 stars 142 forks source link

Update main.py #73

Closed Nikhil18Patil closed 11 months ago

Nikhil18Patil commented 11 months ago

Ensured case-insensitivity and removed leading/trailing whitespace in user input for "AM" or "PM."

Achieved platform-independent console screen clearing using os.system("cls" if os.name == "nt" else "clear").

Improved efficiency by using sleep(1) to continuously check the time, avoiding busy-waiting.

Added a handler for user interruption (Ctrl+C) to gracefully exit the alarm.