To print a list without its first element, you can pass the result of slicing expression
my_list[1:] into the
print() function. This slices from the second list element to the last one. Note that the
start index in the slicing notation
[start:stop] is included in the output of the slicing operation. If the stop index is not provided like here, it means “slice all the way to the end”.
Here’s a simple example that prints the list without the first element
'Alice' using slicing:
lst = ['Alice', 'Bob', 'Carl', 'Dave'] print(lst[1:]) # ['Bob', 'Carl', 'Dave']
Note that this approach even works if the list is empty, so it doesn’t have a first element:
lst =  print(lst[1:]) # 
Beautiful, isn’t it? ❤️
💡 Recommended Tutorial: An Introduction to Python Slicing
I strongly believe this slicing approach
print(my_list[1:]) is the most Pythonic, most concise, and most efficient way to solve this problem so I won’t provide any additional methods that would only be inferior.
On other websites, I have seen approaches like removing the first element from the list using
pop() and printing it afterward. But this is not a great way to solve the problem because it has side effects. Also, it’s less efficient.
👉 Related Tutorials: ⤵️
- Python Print List Without First Element
- Python Print List Without Last Element
- Python Print List Without First and Last Elements
Feel free to join my email academy where you’ll learn exciting new technologies in the coding space such as Blockchain engineering and Python. We have cheat sheets too!
While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.