0

I need a to make multi-line input in Python. This is part of my program:

input_ = input("Enter text:\n") #This can handle only single line of text

Like this:

Enter text:

This is frst line, #Variable input_ would be only this line
this is second line,
this is last line.

I need something that would ask user to enter text (multi-line text) and when user Paste text (Ctrl + C) and he press Enter, program needs to put whole text into a list.

P.S. Please don't mark this as duplicate, because it's a little diffrent than other questions that doesn't help me.

TypicalHog
  • 175
  • 1
  • 3
  • 12

1 Answers1

0

Try using a while loop:

listed = []
inputs = None

while inputs != '':
    inputs = input()
    listed.append(inputs)

listed = [i for i in listed if i != '']
print listed
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70