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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![mohan Abdul](https://secure.gravatar.com/avatar/c2d82f960291404a11c9a865db4a0a92?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
mohan Abdul
Courses Plus Student 1,453 Pointsfor loops video, how did the teacher get the result to print like a banner i.e. a new letter on every line without using
for loops video, how did the teacher get the result to print like a banner i.e. a new letter on every line without using the code """\n""" in his code.
3 Answers
![Jeff Muday](https://uploads.teamtreehouse.com/production/profile-photos/5900142/micro_jeff_face.jpg)
Jeff Muday
Treehouse Moderator 28,718 PointsMohan, the Python print() function by default prints a newline '\n' character at the end. This is can be overridden. See the example below:
print("Print each number in the sequence on a different line")
for x in range(10):
print(x)
print("Now, print on the same line with dashes in between")
for x in range(10):
print(x,end='-')
When we run the code, we get this output.
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
================== RESTART: C:/Users/jeff/Downloads/test.py ==================
Print each number in the sequence on a different line
0
1
2
3
4
5
6
7
8
9
Now, print on the same line with dashes in between
0-1-2-3-4-5-6-7-8-9-
![youssef b10ta](https://uploads.teamtreehouse.com/production/profile-photos/10839501/micro_3AC4F98A-A593-46A6-A5B6-E38E1954C5DB.jpg)
youssef b10ta
Courses Plus Student 2,755 Pointsbecause he did loop through a string
string = 'HELLO'
for letters in string:
print(letters)
![mohan Abdul](https://secure.gravatar.com/avatar/c2d82f960291404a11c9a865db4a0a92?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
mohan Abdul
Courses Plus Student 1,453 Pointsif he did loop through a string how does python program know to print each individual letter on a new line? or is that how python comes?
![Jeff Muday](https://uploads.teamtreehouse.com/production/profile-photos/5900142/micro_jeff_face.jpg)
Jeff Muday
Treehouse Moderator 28,718 PointsThis might be what you are looking for...
Normally the Python 3 print function prints on a single line (with a newline at the end), but you can change the "end" parameter and substitute your own parameter. I am using a space character in the example below.
# Python 3 code for printing
# Team Treehouse Is Tops!
print("Team", end=" ")
print("Treehouse", end=" ")
print("Is", end=" ")
print("Tops!")