How To Display Header In Python

When creating a Python program, you may want to display a header to indicate the purpose of your program or to provide important information to the user. In this tutorial, we will show you how to display a header in Python.


1. Open your Python editor and create a new file.

2. In the first line of your Python file, type in the following code to import the sys module.

3. Next, use the print function to display your header. Enclose the header text in double-quotes.

4. Run your Python file by typing python followed by your filename in the console.

You should now see your header displayed on the console.


In this tutorial, we showed you how to display a header in Python. By using the print function and enclosing your header text in double quotes, you can quickly and easily add a header to your Python program.

Full Code