Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSaugat Mukherjee
3,272 Pointswhere should I use /n here in this code and why so is a must ?
Please find the attached code and tell me why is a bummer coming for not entering (/n)
continents = [
'Asia',
'South America',
'North America',
'Africa',
'Europe',
'Antarctica',
'Australia',
]
# Your code here
for i in continents:
print("*" + i )
1 Answer
Zimri Leijen
11,835 Points\n within a string creates a newline.
It's similar to hitting "return" or "enter" on the keyboard, it will start a new line of text.
Saugat Mukherjee
3,272 PointsSaugat Mukherjee
3,272 PointsWhere should i use it in the above code?
Zimri Leijen
11,835 PointsZimri Leijen
11,835 Pointsprint("*" + i + "\n")