Skip to main content

Framework for generating formatted user input questions.

Project description

MultiChoice

MultiChoice is a framework for generating formatted user input questionnaires.

Class: MultiChoice

MultiChoice(prompt, options, required=True, strict=True)

Generates multiple choice questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, prompt, options, required=True, strict=True)

  • Param prompt: String. Question, query or prompt for the user.
  • Param options: Tuple of Strings. Options presented to the user as a numbered sequence. The user may enter an answer as text or one of the numbers.
  • Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.
  • Param strict: Bool. Default=True True: Answer must be in the options tuple. Not case-sensitive. False: Accepts any answer.

Class: FillBlank

FillBlank(prompt, required=True)

FillBlank: generates fill-in-the-blank questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, prompt, required=True)

  • Param prompt: String. Question, query or prompt for the user.
  • Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.

Class: TrueFalse

TrueFalse(prompt, required=True, strict=True)

TrueFalse generates True or False questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, prompt, required=True, strict=True)

  • Param prompt: String. Question, query or prompt for the user.
  • Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.
  • Param strict: Bool. Default=True True: Answer must be in the options tuple. Not case-sensitive. False: Accepts any answer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MultiChoice-0.1.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

MultiChoice-0.1-py3-none-any.whl (1.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page