Please can explain how to input new lines on python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Please can explain how to input new lines on python

28th Mar 2019, 2:48 PM
CyberKing
CyberKing - avatar
4 Answers
+ 6
print('whatever') ends with a newline automatically. When you want an extra newline, you can use an empty print() Or you end your string on the former line with \n. print('Extra!\n')
28th Mar 2019, 3:08 PM
HonFu
HonFu - avatar
+ 2
You can get multiple lines from input by this code: lines = [] while True: line = input() if line: lines.append(line) else: break
28th Mar 2019, 9:25 PM
Farid Ghr
Farid Ghr - avatar
0
Hello guys
28th Mar 2019, 10:07 PM
IRON ROCK
IRON ROCK - avatar
- 1
Simply \n
10th Apr 2019, 8:02 PM
Roseline Bassey