Created
October 11, 2024 01:29
-
-
Save gh640/b191067cef9dc9e88b568ed5ff4fca11 to your computer and use it in GitHub Desktop.
Python: confirm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def confirm(message: str) -> bool: | |
answer = input(f"{message} [yes/No]: ").strip().lower() | |
return answer in ["y", "yes"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment