Lambda Expressions & Anonymous Functions || Python Tutorial || Learn Python Programming
HTML-код
- Опубликовано: 14 окт 2024
- 𝙎𝙩𝙖𝙮 𝙞𝙣 𝙩𝙝𝙚 𝙡𝙤𝙤𝙥 𝙄𝙉𝙁𝙄𝙉𝙄𝙏𝙀𝙇𝙔: snu.socratica.... Lambda expressions - also known as “anonymous functions” - allow you to create and use a function in a single line. They are useful when you need a short function that you will only use once. For example, when using the map, filter and sort methods.
Please SUBSCRIBE: bit.ly/Socratic...
This video was made possible with the help of our Patrons on Patreon! We would especially like to recognize the generosity of our VIP Patron, Austin Anderson. We're so thankful for your support, Austin!
To learn Python, start our Python Playlist HERE:
bit.ly/PythonHe...
♦♦♦♦♦♦♦♦♦♦
We recommend:
Python Cookbook, Third edition from O’Reilly
amzn.to/2sCNYlZ
The Mythical Man Month - Essays on Software Engineering & Project Management
amzn.to/2tYdNeP
Shop Amazon Used Textbooks - Save up to 90%
amzn.to/2pllk4B
♦♦♦♦♦♦♦♦♦♦
Ways to support our channel:
► Join our Patreon : / socratica
► Make a one-time PayPal donation: www.paypal.me/...
► We also accept Bitcoin @ 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9
Thank you!
♦♦♦♦♦♦♦♦♦♦
Connect with us!
Facebook: / socraticastudios
Instagram: / socraticastudios
Twitter: / socratica
♦♦♦♦♦♦♦♦♦♦
Python instructor: Ulka Simone Mohanty (@ulkam on Twitter)
Written & Produced by Michael Harrison (@mlh496 on Twitter)
♦♦♦♦♦♦♦♦♦♦
Wear a Socratica Python shirt for good luck coding: shop.socratica.com/products/python-by-socratica
Or just use ChatGPT?
I usually don't comment much, but this is not just hilarious, but the pace, presentation style, lack of hipster fluff is impressive and refreshing! Nicely done!
Yes, this video was very easy on the eyes.
Hello, as I am from Brazil, I would like to know the meaning of hipster fluff. Thanks
Great!
@@ruifonseca6147 It means "cheio de onda, com jargões moderninhos"
Agreed, 30 sec in and I'm already laughing. Informative+funny is a very nice way to learn new information. Love the ominous background music too (I was waiting for a Guy Fawkes mask tho xD)
The quality of these python videos is actually incredible.
Agreed... Wait, your are
TheLyreLiar
?
It's like watching sifi movies
Indeed!
I second that
@@hangchen thats true!!!
I felt like going through a tutorial in a game. She somewhat feels like the adjutant in StarCraft and a cool and hype mission is about to happen.
Welcome back, Commander!
Exactly that, this feels like either game tutorial or cyberpunk hacking video.
+1 for most accurate video description ever
I strangely have an urge to listen and absorb the material in this video. I feel like this is a matter of life and death. And if I don't understand and use lambda function correctly, this world will end.
Michael Vu the world hasn’t ended. I guess you have learnt lambda function.
Weirdly same. I wish she was my teacher.
So go and learn it asap hahhahah
..and lambda is so much more potent than explained in this video.. hope you use lambda correctly, this world may not end.
LMAO!
"Some people do not know how to use the shift key"
This is the greatest truth of the universe.
i uSe tHE caPs keY
naw it's just tedious to move your finger, hold it down whilst typing. it screws up ur typing momentum.
@MatZ just because one is lazy to do "the said thing" does not mean he doesnt know how to do it.
Learn to comprehend
@MatZ it's more a factor of laziness
It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉
Liked the way of presenting the topic
Feel free to come anytime your ready!
Thank you for this amazing job.
Just some tips for the next serie...
Most of the time, the most important line of code is at the very bottom of the videos. Thus, It is often hidden by the RUclips player, or by the subtitles (if you activate it). A little bit upper would be perfect :)
Well that was possibly the most entertaining Python video I've ever seen; it was a great explanation as well. This is the first Socratica video I've watched, but I'll definitely make a point to watch some more.
mee too
Same!
Me too.
Thx skynet for teaching me python
You just made python 100x more interesting than it already is. Thank You!
I've been coding for almost two years and yet that's the most innovative tutorial I've ever seen
"I hereby grant you the power to collest vast amount of personal data to do with as you wish." 1:58 Just Brilliant :D
a good news to unknowners
Looks like ASMR for Programmers
That's a very interesting new style of tutorial, very refreshing ... gj
Best Python tutorials on the web. Keep'em comin! :)
That joke about Euler almost killed me
hahaha dead
LOL,yea. Damn cool!
As it well should!
I really appreciate that you show real world examples for all these lessons
I love everything in this video. The pace, the music, sound effects, the learning. Excellent.
you forgot the comedy!
For some reason I've always avoided your videos... now that I watch this lambda one... I'm hooked! Easy clear concise explanations, sorry I judged you!!!
We're glad you've found us! You can subscribe to Socratica here: bit.ly/SocraticaSubscribe
To help us make videos faster, you can become our Patron! www.patreon.com/socratica
I tried out all channels to learn lambda functions, out of all believe me this channel is amazing, I love the way of teaching because I just learn from here lamda functions. I never understand wikipedia and all other programming channels
the best python programming channel on the youtube is back with another outstanding video Welcome Back!!
I don’t understand how you keep a straight face. Thank you for the entertaining tone.
Welcome to Socratica! You can see our entire Python Playlist here: bit.ly/PythonSocratica
Subscribe to see all our new videos! bit.ly/SocraticaSubscribe
great video...
seems like Halo cortana is teaching me
@radheekrshn and Tkinter!
The quality of this video is simply stunning. Can't believe I only stumbled upon this just now.
I really like the mathematical spirit of this channel you are the best
Gatsu
2:55 - You pass the butter.
Lambda : "Oh my God."
I understood that reference
A tad bit late, but me too!
Best python video till date, in terms of fast pace, to the point content, and the fun you add to it. Kudos.
Everyday I watch at least one Socratica Python video and then do one algorithm from Hacker Rank as a practice to start my day
This sounds like a great way to get into peak mental shape!! Thanks for watching!!
I listen to these videos at 2X speed... and I appreciate that your videos actually are well annunciated for that reason
a function has no name! LIAR! *hits with stick*
GOT
omg this is exactly what i thought of when i heard her saying it...
hahah Awesome
Updated:
Lambda: "And what do you say to a function with no name?"
Araya: ""Not TODAY !!!"
Just when I stopped giggling over America's song "A Horse with no name".
So was that a Lambda Horse?
My first on this channel, proof that RUclips recommendations are working well. Earned a subscriber.
best python tutorial on the internet!
I can't believe this is the first video I've seen from this channel. Outstanding!
We're so glad you found us! C'mon, RUclips - help us connect with people who need help!
I love the fact that the girl holding back her laugh in the intro 😂
I dont know what made you decide to make your videos like this but... thank you I cant believe how engaged I was. I loved every minute. Please continue! New suscriber and im going to watch all your videos.
I am so happy so see another female programmer! and this is super interesting. Thank you
Monica Barrow yeah it always pleases me to see a female doing these kinds of stuffs
Well, she is a professional actress, not a programmer. See her webpage at ulkamohanty.com/, she mentions her socratica videos here.
@@mezigueescartefigue1254 Did you read Ulka's CV carefully? She's an actor AND a programmer. She has a degree in Computer Science from McGill University. She's also a choreographer and an incredible chef. We're lucky to work with such talented people!
There are a million
@@mezigueescartefigue1254 sexist scumbag.
I don't typically comment, but this video's delivery is amazing to help learn what was a very confusing topic for me. Thanks!
Clear, absorbable, AND funny? How is this a python tutorial?! Subscribed!
was just thinking of all the programming channels on youtube, haven't seen a single woman teaching! Then there you are! yay!!!
Thank you for your kind comment, Wing! We are a team here at Socratica (both men and women) and we achieve together!
Just watched your wonderful channel trailer. I hope everyone watches it and is inspired: ruclips.net/video/eX4VkEnpmUQ/видео.html
Certainly! It just felt like women seem to be a bit underrepresented in this arena.
I'm so flattered that you liked my video, there's lots to improve on, but your encouragement will motivate me to create more in the future. Thank you!!!!!
We totally hear you. We're baffled by the under-representation of women in STEM...the other side of the coin is that so far we don't have that many women watching our channel. Hopefully that is slowly changing. We need everybody's brainpower to have a bright future for the world!
Keep us posted on how your work goes! :)
Will do! Thank you for the wonderful videos.
@ Wing N.
It seems you have committed an error: Ulka is married.
Don't give up hope. There may be single women teaching programming elsewhere.
(HeeHeeHeeSnort)
Finding these videos extremely useful, love how she simplifies everything all while making it fun to learn
"I was programming in the desert in a function with no name..."
I've been through the source code on a function with no name.
This style is SO great! Jesus, I felt completely immersed in a whole different world. I can feel a relaxing cold wind behind my ears. Please, keep this format.
Finally I can become a pirate as I know how to calculate the trajectory of a cannon ball.
As someone who regularly scrapes RUclips for help on homework… this is officially my favorite python channel. Why didn’t this come up sooner!
great style of teaching .
I just can't say: WOW!!! great job!!!! what an incredibly creative and extraordinary way to teach!!
Hi,
Could you please try to make a video on Multi threading and multiprocessing concepts in python
I don't knnow how I ended up in this channel but I'm both amazed and learning python
Congrats from Brasil
Am I the only person that is digging the background noise?
nope
What noise? Get some crappy headphones like mine.
I'm loving it too!
yes
Very good too
Very first video i saw, superbly executed. it is awesome. Thanks for doing this. Subscribed. Keep up the good work, you have our most sincerest gratitude.
So ... what is the point of a Lamda? Seems like you can name it similar to a normal function, so why not simply use a normal function; or you just use it once in which case you don't need a function at all just use standard old inline procedural style code.
As a person who just started learning the lambda, it seems to act like a placeholder.
I would think its more concise than regular inline procedural style and doesn't unnecessarily pollute the namespace, if you really are just using it once.
Imagine you have two sorting functions - one you only use once and the other all over your code.
If you turn the first one into a lambda expression you can simplify the name of the other function (which makes the rest of your code more concise) because you don't have to be afraid of it colliding with your lambda expression.
Fantastic explanation here on S.O.: stackoverflow.com/a/890188/8476372
I just found this channel and I have to say it is amazing! Pleasant to listen, everything is nicely explained, can't find any con's. Definitely subscribed! :)
A hot girl, is teaching me how to code in 2017, and i'm loving it. this is truly the nuts and bolts of the language, yay i'm just so excited and happy!
You're weird.
Are we at a point where boys finding girls hot is weird?
PushMyCarr Yeah, and that's _definitely_ weird.
isfk i am.
SO she's not an android....? Damn....
Python documentation is more than sufficient for learning things according to me, since i am a beginner, but this provides a very good approach as well. I watched the video and noticed that keywords from the documentation have been frequently used. So if you were wondering the authenticity of these videos. You can trust them, and use the definitions they provide in technical interviews or tests.
Lambdas are fine but generally should be avoided. Why? By virtue of the fact that they're anonymous, code reuse is impaired, as is caching. I'm making an extreme case here, but lambdas should be thought of as a programmers convenience and not a prescribed way to code.
I could not have said it better. There is a high probability that I could have said it worse.
Yep. As we like short functions, the possibility of lambdas as one-liners is not a real argument. Not anywhere else than at the command prompt.
The dramatic way she was speaking caught my attention 😀😀😀😀😀 ..Really value adding video, Thank You
"There are people who don't know how to use Shift key" ....lol
The best python tutorials ever, not only on RUclips but almost all over the net. Thank you!
There is a typo tho at 3:23,
Arthus C. Clarke
Oh man, and we watched this video SO many times checking for typos! ::bangs head on desk:: This is a good time for us to practice wabi-sabi...
As someone I know once said, "Even computers can make mistakes."
Good eye, Alper. If I had similar skills my code would have less bugs.
Every single thing about these videos is awesome! scientific content, sense of humor, directing, art design, makeup, character development, wardrobe...
Wish you made more of these videos ...
I have learned lamdba expression, I'm now 300 IQ
lambda comment: comment + " is idiotic"
It was as if I had found a treasure that I had been searching for for a long time. My observation and advice to followers is that this method is one of the methods of explanation in higher education, meaning that every time you watch the video you will discover something new. Really, thank you very much for helping people in the world, and thanks again for the quality of the video, the likes of which I have never seen before.
This message was so touching. THANK YOU, you really made our day. 💜🦉
Haha.. very nice tutorial...marry me girl
I had to stop and look up "split" to understand why the index -1 refers to the last name. I tried this from memory and kept coming up with "s" for the -1 index of "H. G. Wells." Split actually creates a new list of strings for each part of the string separated by a space. So cool!
Very good presentation, but i do think lambda functions make your code less readable therefore i will not use them. Not trying to make the world better here, but you will receive flag from me whenever i read your code reading these type of functions. They are useless. You can do much better by just writing it out, and give the reader of your code a nice pleasure instead. Believe me, you will feel stupid by making your code look stupid, but your readers will thank you. It will in turn increase software quality and colaboration. Imo do not use this kind of stuff.
You need them to be able to program in a functional way. Look for "functional python programming".
SoupIsReady - just another tool in the toolbox, and like many tools can be used in the wrong place for the wrong purpose - she highlighted that they should be used for simple throw away scenarios, the list search is a classic situation where they shine.
example of lambda saving the day: Using it to pass variables from a tkinter button into the generic function assigned to its "command" variable. Without Lambda, this would take a great deal of effort. With lambda, it is barely any extra code at all.
I tend to agree, but even if you don't use them you need to be able to read them :) Cheers.
The content is amazing, there's no need for this StarTrek style production. Just one screen displaying commands and results is enough. Keep up the good work.
This is me watching your video for the first time. I did not know that someone actually taught like that. I am amazed.
Just found this channel. It's hosted by an android from the future that knows a lot about sloppy humans. I instantly became a fan.
The least I can do to repay your efforts is by subscribing and liking this tutorial. Fab work
I love this presentation. Humorous, well paced, taught by a computer person or person computer. Thank you!
This video cleared a lot of my doubts related to lambda expressions. Thanks.
I really enjoyed. I knew what are lamdas but I couldn't stop watching. What a presentation 👌
Wow. Just wow. This video is absolute perfection. I'm IN LOVE with this.
Probably the best explanation of Lambda functions I've ever seen, well done.
i dont know why, but the thing i am most exited about is that i now know i can get the last element of a list by getting the -1 element.
I played around with it a bit, and apparently by getting the -2 index, you get the second to last index and so on. I dont know why i never learned this, but it is awesome!
this is my first video to solving my lambda expression problem i accidently click the video and i shocked what is happening in this video 😮 then i realized this is the good way for the programmer to interact the viewers and help them by giving accurate and sufficient way to solve their problem 😃 THANK YOU FOR THIS VIDEO I SUBSCRIBED YOUR CHANNEL AND KEEP SUPPORTING BY GIVING A UNIQUE WAY OF STUDYING 😄
Oh my god, You're living it 2080. The way of teaching is amazing, was like watching a thriller movie😍
If I had her as a CS teacher in College I probably would have been coded Linux by now 😂She got me hooked up from the 1st seconds of the video.
Seriously this is by all means superior. Direction, content, pedagogy, tone, effectiveness... you name it. I am so baffled. This is the future of education IMHO.
Beyond content, the presentation is amazing, attention to details, visual effects, sound design, acting play. When Art and Code are united the result can only be hypnotizing 👏👏👏
Finaly someone showed me truely magic, rly useful. Usual tutorials about lambda doesn't explain anything (and boring). Thanks
This is the coolest python video I've ever seen! Very engaging presentation... Wholeheartedly subscribing
It's like I'm in a mission briefing before the level starts at an FPS video game. Very well done.
Just came by this video of your's and realized that you have an amazing way to teach .Will follow your channel to learn any language in the future. Thank you for such quality stuff.
It is an amazing video. I have never see one teaches computer language like this.
從沒見過有人這樣教程式語言的,讓人驚豔!
This has been the most entertaining and well paced instructional video describing Lambda Function basics. (TBH the only one that has made sense!) this earned you a Sub and Share!
From my knowledge (before watching this video), lambda is simply the same as creating a function with only one line; the return thingy. For example,
def X(l):
return l[1:] + l[0]
is the same as
X = lambda l: x[1:] + x[0]
I really fell love with the voice, effects and making of the videos not even udemy can offer ♥️♥️♥️💕
loved the pace and explaination ...+ the voice and sound effect ...is very intersting
this is the highest quality tutorial I've ever seen
like many people said notmally i dont comment as well .. i am still in middle in video and my heart says "Muahh i love you" not on other sense but like human to human and respectble way. Thanks , please keep doing what u doing explanation is great
Your method of teaching is incredible. Keep it up !!!
You, ma'am have got a new sub.
Interesting presentation. Loved it!
Please keep doing these videos. They're a great way to get an overview of a concept and seeing an example before diving into more detail. I've watched college professors on Coursera teaching Python and you beat them hands down on content, presentation, examples, and overall watchability(you nail the humor and tenor). Actually, if you had the time and motivation, would you do a full course with quizzes and projects on a site like Udemy, Coursera, etc? You would be a huge hit!
Best video tutorial ever! Amazing novelty and unique style. Really liked the space-tech vibe! Following!! :D
My online course just threw a lambda expression at me and this video has done a wonderfully efficient job at catching me up to speed. Much love guys! Thank you! Subscribing and you can bet I'll be perusing that playlist :)
Awesome explanation, speed, and incredible quality
Amazing video. I worked in many languages, but this approach of explaining is the best I've seen so far. Keep up the good work
The way you teach is really Awesome, and easily understanble..Thankyou for this video
python, arrays and lambda expressions all rolled up into 1. i'm sold
Woah !! Some really high quality vids ! I'm amazed with the post production and the content !