Yes, You Can Do THIS With Functions In Python

preview_player
Показать описание
Yes, you can do this with functions in Python. #Python #Code #Shorts
Рекомендации по теме
Комментарии
Автор

Yes. You can also ignore one of the values with _

jlebrech
Автор

honestly didnt know this one....never needed to use it yet

GamingAbroad
Автор

It may saves us some bunch of lines. Spectacular hint!

rlyehdate
Автор

Functions can return tuples in first-class type shocker…

johnaldis
Автор

I thought you were going to talk about yield 😂

ntlake
Автор

Did we need to always return it to 3 var, or we can choose only once?

farid-frederick
Автор

You dont return multiple value man. You just return a value which happen to be a tuple. Also you dont return inplicity a tuple. (Unless you dont know how a tuple is declared which it seems the case) a tuple is declared as var = 1, 2, 3 . What is implict on returning return 1, 2, 3. A tuple is declared as soon as you add one comma. Tjis time your short is bit wrong

federicobau
Автор

This seems to be an unPythonic practice, I rather just use dictionaries... lists... and tuples instead.
Have you shown how to do switch-case with dict() in a function whereas we don't need to include the syntax switch and case like that in the new builtin and that in other programming languages?
Another trick almost nobody knows about is using localhost and JSON together to give Python over 1000x more power.

ThankYouESM
Автор

That's just normal tuples and unpacking. Nothing to do with functions.

themiwi
Автор

ok, now show it with a dictionary example)

Naumkovich
welcome to shbcf.ru