Print lists in Python Last Updated : 08 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Printing a list in Python is a common task when we need to visualize the items in the list. There are several methods to achieve this and each is suitable for different situations. In this article we explore these methods.The simplest way of printing a list is directly with the print() function: Python a = [1, 2, 3, 4, 5] print(a) Output[1, 2, 3, 4, 5] Note: This method prints the raw Python list syntax (as a single object), including the brackets and commas.If we want a more cleaner or customized output format then please follow the below discussed approach.Using print() with * operatorWe can use print(*list_name) when we want a simple and clean display of list elements without additional formatting like brackets or commas. The * operator unpacks the list so that each element is printed individually. Python a = [1, 2, 3, 4, 5] # Print without using any separators # between elements print(*a) # Print using separator (,) print(*a, sep =', ') Output1 2 3 4 5 1, 2, 3, 4, 5 Explanation: The * operator unpacks the list and pass its elements as separate arguments to print(). By using sep, we can specify custom separators such as (,).Using a LoopWe can use a loop (for loop) to iterate over each elements of the list and print it. This approach provides complete control over how each element is printed. Python a = [1, 2, 3, 4, 5] # Iterate over each element of list for val in a: print(val, end=' ') Output1 2 3 4 5 Explanation: The end=' ' ensures that each element is printed on the same line separated by a space.Using .join()If we have a list of strings and we want to print our list as a string where all elements are neatly joined together with a specific separator (e.g., commas or hyphens) then we can use .join() to achieve this. This method works best when print list of strings. Python a = ["Geeks", "for", "Geeks"] print(' '.join(a)) OutputGeeks for Geeks Using map() with .join()If our list contains mixed data types (like integers and strings) then we need to convert each element to a string before joining them. By using map(), we can efficiently apply the conversion to every item in the list in a clear and simple manner. Python a = [1, 2, 3, 4, 5] print(' '.join(map(str, a))) Output1 2 3 4 5 Explanation: The map() function applies str() to each element, allowing easy conversion for join().Which method to choose?print(*lst): Clean, simple, bracket-free output..join(): For formatted output of list of string elements.for loop: Full control over iteration and custom formatting.map() with .join(): Handles mixed types for formatted output.print(lst): Best for debugging, shows list with brackets. Comment More infoAdvertise with us Next Article Print lists in Python S Striver Follow Improve Article Tags : Misc Python python-list Practice Tags : Miscpythonpython-list Similar Reads Multi-Line printing in Python We have already seen the basic use of print function previous article. Now, let's see how to use print function for multi-line printing. This can easily be done using multiline string i.e. three single quotes ''' Geeksforgeeks ''' . Let's see different examples to see the demonstration for the same. 1 min read Python print() function The python print() function as the name suggests is used to print a python object(s) in Python as standard output. Syntax: print(object(s), sep, end, file, flush) Parameters: Object(s): It can be any python object(s) like string, list, tuple, etc. But before printing all objects get converted into s 2 min read Python end parameter in print() In Python, the print() function, commonly used for displaying output, by default ends each statement with a newline character (\n), but this behavior can be customized using the end parameter, which allows you to specify a different string (such as a space, comma, or hyphen) to be printed at the end 3 min read Python | sep parameter in print() The separator between the arguments to print() function in Python is space by default (softspace feature) , which can be modified and can be made to any character, integer or string as per our choice. The 'sep' parameter is used to achieve the same, it is found only in python 3.x or later. It is als 3 min read ascii() in Python Python ascii() function returns a string containing a printable representation of an object and escapes the non-ASCII characters in the string using \x, \u or \U escapes. It's a built-in function that takes one argument and returns a string that represents the object using only ASCII characters. Exa 3 min read Indentation in Python In Python, indentation is used to define blocks of code. It tells the Python interpreter that a group of statements belongs to a specific block. All statements with the same level of indentation are considered part of the same block. Indentation is achieved using whitespace (spaces or tabs) at the b 2 min read Python - Printing list vertically When working with lists in Python sometimes it's necessary to print the elements vertically. This can be useful when we want to display each item on a new line or present data in a structured format. In this article, we will explore various methods to print a list vertically starting with the simple 3 min read Python Introduction Python was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation. It was designed with focus on code readability and its syntax allows us to express concepts in fewer lines of code.Key Features of PythonPythonâs simple and readable syntax makes it beginner-frien 3 min read Input and Output in Python Understanding input and output operations is fundamental to Python programming. With the print() function, we can display output in various formats, while the input() function enables interaction with users by gathering input during program execution. Taking input in PythonPython input() function is 8 min read Iterate over a list in Python Python provides several ways to iterate over list. The simplest and the most common way to iterate over a list is to use a for loop. This method allows us to access each element in the list directly.Example: Print all elements in the list one by one using for loop.Pythona = [1, 3, 5, 7, 9] # On each 3 min read Like