For long enough I have used to print out a python list as below:
a = [1,2,3] print(a)
Which is kind of working but without printing it in a nice format. So after experimenting I find a cleaner way to do it:
a = [1,2,3] print(*a)
Tuple behave similarly:
a = (1,2,3) print(a)
a = (1,2,3]) print(*a)
🚀 For people who like video courses and want to kick-start a career in data science today, I highly recommend the below video course from Udacity:
📚 While for book lovers:
- "Python for Data Analysis" by Wes McKinney, best known for creating the Pandas project.
- "Hands-on Machine Learning with Scikit-Learn, Keras, and TensorFlow" by Aurelien Geron, currently ranking first in the best sellers Books in AI & Machine Learning on Amazon.
- "Deep Learning" by Ian Goodfellow research scientist at OpenAI.
This brings us to the end of this article. Hope you like this Python trick.
If you liked this article, please consider subscribing to my blog. That way I get to know that my work is valuable to you and also notify you for future articles.
Thanks for reading and I am looking forward to hearing your questions :)
Stay tuned and Happy Machine Learning.