end = '\n' within input() functions | SoloLearn: Learn to code for FREE!


end = '\n' within input() functions

Is it possible to include a , end = '\n' output within an input() in Python? Or just incorporating \n in any way within strings inside the function.

12/21/2019 11:00:14 PM

Alex Traynor

2 Answers

New Answer


If you want to create a new line in the text prompting for the input, you can't use 'end = ' as input has no parameter of that sort. Or if you want to take multiline input: import sys text = sys.stdin.readlines() print(text) use Ctrl + d when you finish typing the input. It returns a list of the text in each line.


Are you trying to do a multi-line input or are you trying to create a new line in the input prompt?