This notebook-tool demonstrates using the select plugin in your code
The select plugin takes strings separated by new lines and gives the user the option to choose from among them, able to make multiple selections.
To choose default selections for the user you have to formulate your strings list as follows
{mode_select: mode ? mode of transportation}
# Crosscompute
mode_select = """
walk
bike
bike
walk
run
jazz hands
"""
import itertools
modes = [x.strip() for x in itertools.takewhile(lambda x: x.strip() != '', mode_select.strip().splitlines())]
if len(modes) == 0:
print("I don't like to move")
elif len(modes) == 2:
print('I love to %s' % (' and '.join(modes)))
else:
string = ', '.join(modes[:-1]) + ', and %s' % modes[-1]
print('I love to %s' % string)