Book Review — Effective Python, by Brett Slatkin. An overview of Effective Python, by Brett Slatkin (principal software engineer at Google), reveals 90 specific ways to write better Python code.
Those among you who have already learned some Python or may even have used it in some projects will certainly have heard the expression “Pythonic Code”, which conveys a general and somewhat wide meaning of “clean code and good software development practices in the context of Python”. With Effective Python, the author presents you with nothing less than 90 practical examples on how to adopt a pythonic developer mindset and how to write better Python code.
This is the second edition of a great book that Brett Slatkin had published in 2015, and which many of you may still recall. But this new edition has lots of new content (it has grown from 59 to 90 subjects or sections, and from around 250 to more than 400 pages). It has also been updated to cover some important new features that are included in recent Python versions, up to Python 3.8, which is currently the most up-to-date stable version and will be supported for some years after 3.9 comes out.
So, even if you have read the first edition, it may be worth checking it out because, besides having been revised and updated to reflect the constantly evolving best practices, it covers some more recent topics like assignment expressions (a.k.a. the walrus operator).
In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.
Magic Methods are the special methods which gives us the ability to access built in syntactical features such as ‘<’, ‘>’, ‘==’, ‘+’ etc.. You must have worked with such methods without knowing them to be as magic methods. Magic methods can be identified with their names which start with __ and ends with __ like __init__, __call__, __str__ etc. These methods are also called Dunder Methods, because of their name starting and ending with Double Underscore (Dunder).
Here is a quick list of 10 that you can immediately start doing in your code.
In this tutorial, you’re going to learn a variety of Python tricks that you can use to write your Python code in a more readable and efficient way like a pro.
Today you're going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates. We gonna use Python OS remove( ) method to remove the duplicates on our drive. Well, that's simple you just call remove ( ) with a parameter of the name of the file you wanna remove done.