def yesno(prompt='? '):
	# raw_input returns the empty string for "enter"
	yes = set(['yes','y', 'ye', ''])
	no = set(['no','n'])

	choice = input(prompt).lower()
	if choice in yes:
		return True
	elif choice in no:
		return False
	else:
		sys.stdout.write("Please respond with 'yes' or 'no'")

from six.moves import input

def yesno(prompt='? '):
	# raw_input returns the empty string for "enter"
	yes = set(['yes','y', 'ye', ''])
	no = set(['no','n'])

	choice = input(prompt).lower()
	if choice in yes:
		return True
	elif choice in no:
		return False
	else:
		sys.stdout.write("Please respond with 'yes' or 'no'")

Support input() on python 2.
Support input() on python 2.

+ from six.moves import input
+ 
  def yesno(prompt='? '):
  	# raw_input returns the empty string for "enter"
  	yes = set(['yes','y', 'ye', ''])
  	no = set(['no','n'])
  
  	choice = input(prompt).lower()
  	if choice in yes:
  		return True
  	elif choice in no:
  		return False
  	else:
  		sys.stdout.write("Please respond with 'yes' or 'no'")
  
Support input() on python 2.
## Code Before:
def yesno(prompt='? '):
	# raw_input returns the empty string for "enter"
	yes = set(['yes','y', 'ye', ''])
	no = set(['no','n'])

	choice = input(prompt).lower()
	if choice in yes:
		return True
	elif choice in no:
		return False
	else:
		sys.stdout.write("Please respond with 'yes' or 'no'")

## Instruction:
Support input() on python 2.
## Code After:
from six.moves import input

def yesno(prompt='? '):
	# raw_input returns the empty string for "enter"
	yes = set(['yes','y', 'ye', ''])
	no = set(['no','n'])

	choice = input(prompt).lower()
	if choice in yes:
		return True
	elif choice in no:
		return False
	else:
		sys.stdout.write("Please respond with 'yes' or 'no'")
