How to Print a List Without Brackets in Python Last Updated : 04 Dec, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will see how we can print a list without brackets in Python. Whether we're formatting data for user interfaces, generating reports, or simply aiming for cleaner console output, there are several effective methods to print lists without brackets.Using * Operator for Unpacking List ElementsThe most simple and efficient method is using * operator to unpack the list elements when passing them to the print function. It prints the list elements separated by spaces without the need for additional formatting. Python li = [1, 2, 3, 4, 5] print(*li) Output1 2 3 4 5 Below are some of the advanced approaches to print a list without brackets in Python.Table of ContentUsing For Loop to Print List Element Without Brackets Using the str() Function with String SlicingUsing the * Operator for Unpacking the List ElementsUsing join() Method (Specified Delimiter )In this example, we are using join() method to concatenate the elements of a list into a single string separated by a specified delimiter. Python li = ['4', '5', '6'] print(', '.join(li)) Output4, 5, 6 Explanation:The code creates a list li containing the strings '4', '5', and '6'.It then joins the list elements into a single string with , as the separator and prints 4, 5, 6.Note: We can replace the delimiter ', ' with any delimiter we want in the join() method. The join() method does not have a default delimiter; it must be explicitly specified.Using str() Function with String SlicingThe str() function can be combined with string slicing to remove the brackets from the list representation. Python li = [1, 2, 3, 4, 5] print(str(li)[1:-1]) Output1, 2, 3, 4, 5 Explanation:The code converts the list li into a string and removes the first and last characters which are the square brackets.It then prints the resulting string which is the list's elements separated by commas without the brackets.Using For LoopIn this example, we are using a loop to iterate over the list elements and print them without brackets. Python li = [1, 2, 3, 4, 5] for i in li: print(i, end=' ') Output1 2 3 4 5 Comment More infoAdvertise with us Next Article How to Print a List Without Brackets in Python S shivangtomar257 Follow Improve Article Tags : Python Python Programs python-list Python list-programs Practice Tags : pythonpython-list Similar Reads How to Print without newline in Python? In Python, the print() function adds a newline by default after each output. To print without a newline, you can use the end parameter in the print() function and set it to an empty string or a space, depending on your needs. This allows you to print on the same line. Example:Pythonprint("geeks", en 3 min read How to Print a Tab in Python In Python, printing a tab space is useful when we need to format text, making it more readable or aligned. For example, when displaying data in columns, we might want to add a tab space between the values for a cleaner appearance. We can do this using simple methods like \t, the print() function or 2 min read How to Print a Dictionary in Python Python Dictionaries are the form of data structures that allow us to store and retrieve the key-value pairs properly. While working with dictionaries, it is important to print the contents of the dictionary for analysis or debugging.Example: Using print FunctionPython# input dictionary input_dict = 3 min read Ways to Print List without Quotes - Python The task of printing a list without quotes in Python involves displaying the elements of the list without the default string representation which includes quotes around string elements. For example, given the list a = ['a', 'b', 'c', 'd'], the goal is to print the list in the format [a, b, c, d] wit 2 min read Print a List of Tuples in Python The task of printing a list of tuples in Python involves displaying the elements of a list where each item is a tuple. A tuple is an ordered collection of elements enclosed in parentheses ( ), while a list is an ordered collection enclosed in square brackets [ ].Using print()print() function is the 2 min read Like