Created
February 6, 2022 15:56
-
-
Save MartinThoma/bc7294b25567e1bfd9ec2964447e03b3 to your computer and use it in GitHub Desktop.
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
from rich.prompt import Prompt, Confirm | |
is_correct = False | |
while not is_correct: | |
name = Prompt.ask("Enter your name", default="Martin") | |
is_correct = Confirm.ask(f"Is your name '{name}'?") | |
age = Prompt.ask( | |
"What is your age group", | |
choices=["<18", "18-25", "25-35", ">35"], | |
default="25-35" | |
) | |
print(f"You are {name} and your age is {age}.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment