Answers for "read multiple line input python"

2

multiple line input python

lines = []
while True:
    line = input()
    if line:
        lines.append(line)
    else:
        break
text = '\n'.join(lines)
Posted by: Guest on February-03-2021
0

multiple lines input python

print("Enter/Paste your content. Ctrl-D or Ctrl-Z ( windows ) to save it.")
contents = []
while True:
    try:
        line = input()
    except EOFError:
        break
    contents.append(line)
Posted by: Guest on December-04-2021

Code answers related to "read multiple line input python"

Python Answers by Framework

Browse Popular Code Answers by Language