Here are some numbers on the size of Python and everything you can learn.
Python 🐍 is a huge language:
There's always something to keep you busy! Let me tell you exactly how busy:
Python 3.10 has 71 built-in functions.
The built-in functions are the functions that you can use without having to import anything.
Among them you can find
>>> compile("def f(): return 42", "", "exec") <code object <module> at 0x0000028A4183CD40, file "", line 1> >>> __import__("math") <module 'math' (built-in)>
Python 3.10 has many built-in types and they come with many methods:
And strings?! Don't even get me started on strings. How many methods do you think strings have? Care to take a guess? Drumroll, please...
Strings have 47 methods: capitalize, casefold, center, count, encode, endswith, expandtabs, find, format, format_map, index, isalnum, isalpha, isascii, isdecimal, isdigit, isidentifier, islower, isnumeric, isprintable, isspace, istitle, isupper, join, ljust, lower, lstrip, maketrans, partition, removeprefix, removesuffix, replace, rfind, rindex, rjust, rpartition, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, and zfill!
That's a lot of string methods... And these counts I presented exclude things like dunder methods, which are also quite a few... So, learning all of this will take you some time!
There is also the standard library, which is also huge! The Python Standard Library has almost 250 modules! That's why they say Python has “batteries included”... Those are some big batteries! 🤣
Did you know that Python 🐍 has over 240 modules in the standard library?— Rodrigo 🐍📝 (@mathsppblog) August 24, 2021
Here is a MEGA thread 🧵with a super high level overview of those modules...
... but before that, I challenge you to name as many modules by heart as possible! 💬👇
Let's see who gets more!
And if all of this isn't enough, you can always head over to PyPI, the Python Package Index. On PyPI you can find all the packages that people have published for others to use. As of writing this thread, there are 371,830 projects on PyPI! That's a lot of code 😁
So, as you can see, Python really is huge and there is a LOT to learn. In fact, I think you will never learn ALL of it. But that's fine.
In fact, I am of the opinion that mastering Python is impossible, and that's actually OK. The point is not to know it all.
I actually wrote an article a couple of months ago about this subject. In it, I describe how I go about navigating those numbers and always learning something new without suffering from paralysis by analysis: https://mathspp.com/blog/pydonts/why-mastering-python-is-impossible. Go ahead and give that a read!
One of the main takeaways is that you don't need to learn all of Python. You just need to learn a bit and start practising and building things. Then, keep learning, bit by bit, gradually... And you will keep improving 🚀
I hope you learned something new! If you did, consider following the footsteps of the readers who bought me a slice of pizza 🍕. Your small contribution helps me produce this content for free and without spamming you with annoying ads.