All 71 built-in Python functions

preview_player
Показать описание
How many did you know?

A quick rundown of EVERY single one of the 71 builtin Python functions. Technically, these are not all functions, but these are the 71 callables that are listed in the Python docs as "Builtin functions". These are the global names that are available to call that you don't need to install or even import anything to use.

SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!

Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)

Want to donate crypto? Check out the rest of my supported donations on my website!

Top patrons and donors: Laura M, Jameson, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi

BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------

CHAPTERS
---------------------------------------------------
0:00 Intro
0:24 Math - bool int float complex max min divmod abs pow round sum
2:56 Collections - dict list tuple set frozenset
3:44 Strings - bytes bytearray str memoryview open
5:18 Strings - chr ord bin oct hex format input ascii repr
7:04 Iteration - iter next enumerate zip reversed sorted filter map
9:17 Iteration - all any range slice aiter anext
10:42 Debugging - breakpoint help print
11:16 Object - object getattr setattr delattr hasattr dir id
14:19 Object - hash len isinstance issubclass callable super type
16:29 Descriptors - property classmethod staticmethod
17:49 Dynamic - eval exec compile globals locals vars __import__
Рекомендации по теме
Комментарии
Автор

2:25 "But be careful, due to floating point rounding errors, rounding using python may not give you the same answer as rounding like you learned in school"
Yea, rounding 2.6... to 3.6... is indeed new to me :D

My favourite has gotta be ol' reliable print()

Talon_
Автор

For zip(), don't forget it terminates at the end of the shortest iterable and you can pass the kwarg 'strict' to force it to accept only iterables of equal length (added in 3.10).

unusedTV
Автор

print() has actually so many useful kwargs. Every time I see something like outfile.write("\t".join(map(str, data)) + "\n") in a code base when you could just do print(*data, sep="\t", file=outfile), I die a little inside.

Other kwargs to note are end and flush. There may be more but these are the ones I use often

ExplicableCashew
Автор

Another useful feature of slice is `slice(None)` which is equivalent to the colon operator, namely `x[slice(None)] == x[:]`. Typically, it's used when you want to pass an index around, but in some cases need the whole iterable. Also works with numpy arrays and pandas tables.

yaroslavdon
Автор

I have literally seen people reading a python file as text and calling exec on that, so __import__ does not really scare me... they should have watched this video ! thanks for the great content !

paper_cut
Автор

big respect. this is a wonderfully crafted video that's super well explained

e
Автор

really good video, I loved the dynamic functions part!

LukasSmith
Автор

Fun fact: doing type(some_object)() will actually call the constructor, and make a new object of whatever type some_object is

looijmansje
Автор

Slice is amazing! Idk how i survived without this, especially operating with arrays

serafimgrubas
Автор

This was the best short summary. Thank you

skal
Автор

dict function is really cool, because you can create a dict in a function-like manner dict(first_name="Bob", age=20) instead of {"first_name": "Bob", "age": 20}.
Also set is the only way you can create an empty set

Splish_Splash
Автор

I nearly knew about em all, but learned a lot nonetheless. loved this. thank you.

amortalbeing
Автор

I’m going to list this video as mandatory watching for beginners. Great explanations!

MakeDataUseful
Автор

I was waiting for this for a long time

aylazer
Автор

Very nice. Have you considered, or have you already done, a video of all the dunder methods?

quintrankid
Автор

wow that is one of the fatest speaking video you made. I had to pause at multiple times to digest the information.
It was still a very good video, I hope you'll cover itertools, functools and other similar libs in an other video:)

elrandira
Автор

5:45 since bin, oct and hex gave prefixed notations (0b, 0o, 0x) you could pass int(n, 0) to autodetect the base. Also, lowercase x is not the multiply sign ×.

LoneTech
Автор

8:21 yeah, reversed works with dict, but dict keys order is not guaranteed, so I don't see this as a "useful feature". Or am I just wrong?

ЕвгенийКрасилов-оо
Автор

Already know them all. My favorite -- in the sense that I keep using it nearly every time -- is of course enumerate().

Now make one for the dunder methods/attributes!

PanduPoluan
Автор

18:45 love that i discovered this one recently, and I actually have a legit use case for it. since variables in python namespaces are accessed by hash table, dumping a bunch of variables I'll need to use from a specific dictionary (among many in a bigger dictionary) to the namespace and then deleting the dictionary is a neat way to access everything efficiently without keeping / using that large data structure and subscripting anything. sure, I could just define my own hash table instead, but doing this made for an easy refactor job and makes the code more readable in the end

guy_th