In [1]:
import nbinteract as nbi
In [2]:
nbi.multiple_choice(question="What is 10 + 2 * 5?",
choices=['12', '60', '20'],
answers=2)
In [3]:
nbi.multiple_choice(question="Select all prime numbers.",
choices=['12', '3', '31'],
answers=[1, 2])
In [6]:
nbi.short_answer('What is 1+1?', answers='2', explanation='1+1 is 2')
In [7]:
nbi.short_answer('Enter the first name of a member of the Beatles.',
['John', 'Paul', 'George', 'Ringo'])
In [5]:
nbi.short_answer('Enter an even number.', lambda x: int(x) % 2 == 0)