Skip to content

Instantly share code, notes, and snippets.

@ellygaytor
Last active December 2, 2021 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ellygaytor/451d21538e51f791fdf0f39c3658d978 to your computer and use it in GitHub Desktop.
Save ellygaytor/451d21538e51f791fdf0f39c3658d978 to your computer and use it in GitHub Desktop.
Allow multi-line input
def multi_input(prompt = None):
lines = []
while True:
line = input(prompt)
if line:
lines.append(line)
else:
break
output = '\n'.join(lines)
return output
def multi_input_list(prompt = None):
lines = []
while True:
line = input(prompt)
if line:
lines.append(line)
else:
break
return lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment