0

How can I copy and paste this as user input in Python?

"Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit, sed quia non numquam eius modi tempora
incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut
enim ad minima veniam, quis nostrum exercitationem ullam corporis
suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
Quis autem vel eum iure reprehenderit qui in ea voluptate velit
esse quam nihil molestiae consequatur, vel illum qui dolorem eum
fugiat quo voluptas nulla pariatur?"

Edit: input() doesn't work, I am getting this in console: https://pastebin.com/raw/Pc55u0KX

2
  • 1
    Have you tried "input()" function? eg. str=input() It will take your paragraph as the input. Commented Nov 29, 2021 at 11:26
  • @SakshamDubey Yes ofcourse, but I am unable to. Please refer to the main post for an edit. Commented Nov 29, 2021 at 11:35

1 Answer 1

1

After inserting multiline text, click enter with empty input and it will insert and split all lines into list.

def multiline_input(sentinel=''):
    for inp in iter(input, sentinel):
        yield inp.split()

lis = list(multiline_input())
print(lis)

Source: Python: Multiline input converted into a list

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.