+ 2

how do I get line breaks? name = input("What is your name?:") print("Hiya, " + name) age = int(input("Tell me your age:")) year = str((2016 - age) + 100) num = int(input("Enter a number between 1 and 50:")) line = str((name + " will be 100 in the year " + year) * num) print(\n line)

I've tried moving the \n about but it never works

8th Sep 2016, 10:32 AM
ZipZapp09
ZipZapp09 - avatar
3 Answers
+ 6
print("\n" + line)
8th Sep 2016, 10:46 AM
Zen
Zen - avatar
0
Ok
20th Sep 2016, 7:06 PM
Roman Asanov
Roman Asanov - avatar
0
try adding "\n", after the end of string in the same line ( in line 6, after + year)
20th Sep 2016, 7:34 PM
shiv
shiv - avatar