You can download this code by clicking the button below.
This code is now available for download.
This function allows the user to select a question from a predefined list. The user is prompted to make a selection, and the function returns the selected question.
Technology Stack : PyInquirer
Code Type : Interactive list selection
Code Difficulty : Intermediate
def list_questions(questions):
from pyinquirer import List
question = List(
prompt="Please choose a question to ask:",
choices=questions
)
return question.prompt()