Skip to content
← Back to Community
How to make a Beautiful Output
Profile icon

What is Beautiful Output?

hmmmm, what is beautiful output. Well, beautiful output is something that I made up. Basically, what it is making your code output look good and organized. The whole point of this tutorial is for you to learn how to make your python code output look good.

Everyone has their own opinion, therefore if you disagree thats cool, if you have any constructive feedback, thats cool too, put it in the comments.


In number 1 we are introducing \n. \n is useful because you can make a new line with it. Like this:


That can be used in many ways. For example,

print("You say Hii") print("\n\n") print("She says hello")


In number 2 we will learn about clearing the console, this is useful because we can clear any lines that we don't want.
This is my way on how you clear the console:

import os def clear(): os.system("clear")

os is a really cool module that is useful for many things. In this case we are using os for clearing. Lets put this code into an example:

hi = input("What is your name: ") clear() print(f"hi, {hi}")


In number 3, we are going to learn about colors! Colors make your code come to life! There is only one problem, how do we get colors? There are many ways, but my favorite is termcolor. Here is how it works:

import termcolor termcolor.cprint("Hi", 'green') # or you could do print("hi"+termcolor.colored("my name is...", "green"))

Thank you for coming to my tutorial

Hoped you enjoyed and bye

Profile icon
Profile icon
Profile icon

Uh termcolor is bad, just use ANSI:


Profile icon

hi, in your tutorial you do this

print("You say Hii") print("\n\n") print("She says hello")

But why would you do that? Surely it makes a lot more sense to do this

print("You say Hii\n\n\n\nShe says hello")