Please Master These 10 Python Functions…

  Рет қаралды 90,806

Tech With Tim

Tech With Tim

Күн бұрын

Get started with Mailtrap today! l.rw.rw/tech_with_tim
In this video, I will dive into 10 Python Functions that you NEED to master. Some of them may seem simple, but they have a lot of additional parameters that you need to understand and mastering all of the functions can save you a ton of time when writing any type of code in Python.
If you want to land a developer job check out my program with CourseCareers: techwithtim.net/dev
⏳ Timestamps ⏳
00:00 | Overview
00:16 | Function #1 - print
02:23 | Function #2 - help
04:28 | Function #3 - range
06:38 | Function #4 - map
09:12 | Function #5 - filter
10:57 | Function #6 - sum
11:41 | Function #7 - sorted
13:31 | Function #8 - enumerate
15:10 | Function #9 - zip
18:00 | Function #10 - open
Hashtags
#techwithtim #python #pythonprogramming #coding #codingtips

Пікірлер: 79
@TechWithTim
@TechWithTim Ай бұрын
I have a free introduction course on how to land a developer job in 2024 here: techwithtim.net/dev
@johnbennett1465
@johnbennett1465 Ай бұрын
Print also takes a file argument to write to a file.
@RemyDelaCruz
@RemyDelaCruz Ай бұрын
Used some of these for a recent class, and this serves as a refresher! Great content.
@MansiBansalc
@MansiBansalc Ай бұрын
For the first time ever i understood how lambda functions work. Thankyou so much Tim!!
@legojenn
@legojenn Ай бұрын
Thanks! I never understood lambda functions. I overcomplicated it.
@Chiramisudo
@Chiramisudo 17 күн бұрын
They're just anonymous / unnamed functions. JavaScript, C#, and many other languages have the same concept.
@softwareengineer8923
@softwareengineer8923 Ай бұрын
Thanks a lot Tim, it was such a helpful recap for me. Keep up the high quality content.
@raghunathansundaresan8017
@raghunathansundaresan8017 Ай бұрын
I've always been using key argument in sorted function by trial and error. Finally I understood. Thanks Tim great video as usual!
@christoph231090
@christoph231090 Ай бұрын
These "basic" videos are very nice. Thanks for that one.
@Superstar-nl5tl
@Superstar-nl5tl 4 күн бұрын
Why are all the python tutorials explained lightning fast as if I am already a pro and know what it is talking about?
@zackzintho48
@zackzintho48 Күн бұрын
Maybe they're made for people already familiar with these things but don't know exactly how they work. This one is clearly not for absolute beginners who don't know what a function is. There are many more tutorials that assume you're an absolute beginner. Example is Harvard's CS50 Python tutorial...
@dragonfly-7
@dragonfly-7 6 сағат бұрын
Hi Tim ! #10 @18:03. I didn't know that I'm able to both read to a file and write from a file ... You'll never stop learning ... 😉
@ameldancalippo6912
@ameldancalippo6912 18 күн бұрын
Nice simple explanations that start you thinking of how you can use these functions. Exactly how you want to feel when learning a language.
@kapibara2440
@kapibara2440 Ай бұрын
Thank you for the video Tim 😃
@johnbennett1465
@johnbennett1465 Ай бұрын
Zip takes a strict argument when it is important that the lists are the same length. Without it zip can hide bugs in your list generation.
@alimihakeem841
@alimihakeem841 Ай бұрын
Tim, Thanks so much. I do love your content. It's valuable
@Dr_Adar
@Dr_Adar Ай бұрын
Helped me a lot! thanks!
@jimalix6270
@jimalix6270 Ай бұрын
Extremely helpful video! Thanks so much!
@johnbennett1465
@johnbennett1465 Ай бұрын
Using enumerate(tasks, 1) makes the code even cleaner. The second parameter is the start value.
@Joeadamu
@Joeadamu Ай бұрын
This is true then what about the full stop after the number because you don't wanna be using a comma...
@johnbennett1465
@johnbennett1465 Ай бұрын
@@Joeadamu all my change does is use enumeration values from 1 to N instead of 0 to N-1. You also remove the " + 1" from the print call. Everything else remains unchanged. In this case it is a small improvement. In more complicated cases it can make the code noticeable clearer and reduce the chances of off by one errors.
@Joeadamu
@Joeadamu Ай бұрын
@@johnbennett1465 Oh yeah... I get your point, thanks for the clarification :)
@fancypants6062
@fancypants6062 19 күн бұрын
omg I can't believe I never knew about this. I use enumerate so much. Thank you.
@johnbennett1465
@johnbennett1465 19 күн бұрын
@@fancypants6062 you're welcome.
@SchwarzschildM
@SchwarzschildM Ай бұрын
Any chance to have all of the functions within Jupiter notebook or code file for further usage?
@jamesharrington233
@jamesharrington233 17 күн бұрын
Very informative, thank you!
@jayd_ee
@jayd_ee Ай бұрын
Thank you so much ❤️
@sun-prairie
@sun-prairie 14 күн бұрын
thanks for the excellent intro to functions
@samuelvanhoolandt9725
@samuelvanhoolandt9725 Ай бұрын
Thank you !
@souris_a_boule5695
@souris_a_boule5695 Ай бұрын
For the sum function, there is a cool thing you can do with the start argument. You can put any type that support the + operator. So for example if you want to flatten a list of list you can pass it with start=[] and it will get the job done
@johnbennett1465
@johnbennett1465 Ай бұрын
Interesting. I tried to use it to append strings and it doesn't work. Since the error message explicitly says to use join, it must be explicitly checking for.
@souris_a_boule5695
@souris_a_boule5695 Ай бұрын
@@johnbennett1465 Ah that's weird I tried it with a list and it works so I assumed that it work with any object that support + operator. Guess I'm wrong
@souris_a_boule5695
@souris_a_boule5695 Ай бұрын
After some research I found out that the sum function specificaly "ban" string for optimization reason and encourage you to use join instead. I don't know if other types are checked
@johnbennett1465
@johnbennett1465 Ай бұрын
@@souris_a_boule5695 thanks for the information. I should have guessed this. I am aware of the performance issues.
@htcsaj7876
@htcsaj7876 Ай бұрын
Any advices or tutorial how to create python SaaS project
@ExDarkx3
@ExDarkx3 Ай бұрын
i always swap out map/filter for list/dict comprehensions just because of readability. I feel like the only time time ill ever use them is if im using a terribly large dataset and im facing memory issues with list comprehensions. Even so, im in devops so i rarely face that problem
@DavidParathyras
@DavidParathyras Ай бұрын
Master has been pleased 😁
@avvarutheja
@avvarutheja 18 күн бұрын
What is the advantage of map and filter functions, the same can be achieved with single line list_comprehension aswell. Curious to know what are the added advantages of using these map & filter functions. My approach for the items discussed in the video are : strings = ["my", "world", "apple", "pear"] l_comp = [len(i) for i in strings] print(l_comp) l_append = [i + "s" for i in strings] print(l_append) l_filterd = [i for i in strings if len(i) >4] print(l_filterd)
@PixelMotionHD
@PixelMotionHD Ай бұрын
Can "with" statement be used with modules for database operations as well?
@ChopLancer
@ChopLancer Ай бұрын
I've tried that with psycopg and didn't work the same. Other packages might be different but just follow their documentation
@ralvarezb78
@ralvarezb78 Ай бұрын
I often use lambda functions with filter and map
@dimox115x9
@dimox115x9 Ай бұрын
Plz i need your need in one of ur videos to build IA Agent advanced python using RAG : I did pip install llama-index-experimental so many times and also the upgrade version. I did ' from llama_index.experimental.query_engine import PandasQueryEngine ' and it says ' no module name llama_index.experimental '. Weird plz anyone?
@user-if1dj7fy2y
@user-if1dj7fy2y Ай бұрын
Salute 🙌 Bravo 👏👏 Lit 🌠 Impressive 👌❤ gratitude ✨ for your satisfactory Work 💪🚀🌱
@KJHounchou
@KJHounchou Ай бұрын
Is your freecodecamp machine learning with python course still useful for beginners? if you have a better course, could you tell me? I'm trying to get into an apprenticeship of software engineering and I'm not sure if it's the right decision to spend time on a 4 years old course. Thank you.
@user-ry6bo8cq5s
@user-ry6bo8cq5s 3 күн бұрын
I used the help function to create a python bot (not released)
@101Mant
@101Mant Ай бұрын
I guess you need to know map and filter so you can replace them with comprehensions which you should be using instead.
@hadisardari1564
@hadisardari1564 Ай бұрын
Dear Team, Thank you for your awesome content. I would like to request that you speak a little slower, if possible. For those of us whose native language is not English, your speaking speed can sometimes be a bit fast and unclear, causing us to miss some parts of the content.
@rassy7
@rassy7 Ай бұрын
Tim Overflow is sooooo much easier to understand than Stack Overflow.
@AllPraiseToYah
@AllPraiseToYah Ай бұрын
😂😂😂
@Chiramisudo
@Chiramisudo 17 күн бұрын
So is Claude AI. I still prefer the human element though, and always will, but when you want a quick discrete answer, AIs are great at summarizing results from many websites. I actually found Leo (Brave's AI built into their search engine) to be excellent at this.
@markramsell454
@markramsell454 Ай бұрын
Python does many things for you that I used to do explicitly.
@Fr74n
@Fr74n Ай бұрын
Your content is gold
@TechCodeGate213
@TechCodeGate213 Ай бұрын
@nargileh1
@nargileh1 12 күн бұрын
Trying to think of realistic uses cases for 'map' that you can't do with comprehensions ...
@Wopara
@Wopara 9 күн бұрын
I guess map just looks cleaner
@zyphtron
@zyphtron Ай бұрын
Tuple = "Toople", not "Taple"!
@AS-rg9ly
@AS-rg9ly Ай бұрын
Wait, are these functions or methods?
@johnbennett1465
@johnbennett1465 Ай бұрын
Some are types. Some are functions. Some are functions that turn around and call a method on a parameter.
@danial9705
@danial9705 Ай бұрын
First !
@mahdihasan42
@mahdihasan42 Ай бұрын
python is getting semmiler like react js.... :)
@FeverYonge
@FeverYonge Ай бұрын
Never liked the "with" thing for files, even the Python professor in college said to not use it, same for list comprehension. Why make something easy one step more complicated for the mind to translate? If its cleaner on my mind , I don't care how it looks on an editor
@TechWithTim
@TechWithTim Ай бұрын
It has nothing to do with “looking good” it’s about utilizing the context manager for safety when operating with a file. It has a real utility in that it catches and resolves and file reading/writing errors automatically for you and ensures the file is closed correctly regardless of what you do. That’s why you use it.
@FeverYonge
@FeverYonge Ай бұрын
@@TechWithTim Ok, yet we were taught to put a try/except block for the open() and close() anyway. It was funny when it came to solving some exercise most students were using the "with" thing cause most of the solutions copied online had that, same with the zip function for some other task. It was an easy way for the professor to distinguish between who copied it without understanding much and who solve it the "longer" way but actually understood it.
@ChopLancer
@ChopLancer Ай бұрын
I have had issues copying files from an FTP server from not using with. Using with prevented me from having anymore blank files. I probably wasn't closing them properly but never need to worry about that using with
@JohannVF
@JohannVF Ай бұрын
I can never see "rng" as anything other than random number generator....
@Choco794
@Choco794 Ай бұрын
Anyone notice how he said maletrap instead of mailtrap.
@jirayuvijjakajohn295
@jirayuvijjakajohn295 Ай бұрын
how could you notice the difference in pronunciation between 'male' and 'mail
@Choco794
@Choco794 Ай бұрын
Oops I meant he wrote male trap instead of mailtrapsince there's no difference in the pronunciation between the two.
@emmang2010
@emmang2010 Ай бұрын
Guys just come across these during development. No need to watch formal videos on these really ever.
@ChopLancer
@ChopLancer Ай бұрын
I disagree, he showed there are ways around using these, if you don't know it's there, how else can you learn it's there unless someone shows you
@shaduhhh
@shaduhhh Ай бұрын
First here 👇👇
@lapislazuli1949
@lapislazuli1949 Ай бұрын
are you 23 years old?
@2Xb73OdF5
@2Xb73OdF5 27 күн бұрын
You lost me at mailplop
@TheFollower1
@TheFollower1 5 күн бұрын
LoL
@xmelsky
@xmelsky Ай бұрын
Waste of my time
@JebadiaSmith
@JebadiaSmith Ай бұрын
No thanks... Working on a computer for a living seems like it is going to become completely obsolete in less than 5 years. Why spend time learning useless things... Does anyone use cursive writing any more? It used to be the optimised form of communication.. But I would argue that every second I was taught how to cursive write was a waste of time and energy that could have been spent on more useful fundamental skills.. Now learning AGI Command prompts.. That seems to be where the future is headed.. My first computer was a MS Dos. Using functions like this used to be how it was done. But certainly not for much longer..
@101Mant
@101Mant Ай бұрын
As a coder who has used several AI code tools I have absolutely no fear for my job given the quality of the code they produce. Nor are they likely to get notably better in the future as throwing more training data at them leads to diminishing returns. Even if you can get it to produce the right code, you need to understand what it has produced to know it's right. AI has potential to be a useful aid but it's massively over hyped right now so all the startups can get that sweet VC cash.
@raghunathansundaresan8017
@raghunathansundaresan8017 Ай бұрын
I've always been using key argument in sorted function by trial and error. Finally I understood. Thanks Tim great video as usual!
Python Lambda Functions Explained
8:07
Tech With Tim
Рет қаралды 26 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 102 М.
Cool Items! New Gadgets, Smart Appliances 🌟 By 123 GO! House
00:18
123 GO! HOUSE
Рет қаралды 13 МЛН
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 5 МЛН
All 39 Python Keywords Explained
34:08
Indently
Рет қаралды 136 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,1 МЛН
How To Use List Comprehension In Python
6:41
Taylor's Software
Рет қаралды 6 М.
Python Object Oriented Programming (OOP) - For Beginners
53:06
Tech With Tim
Рет қаралды 3,3 МЛН
Create A Python API in 12 Minutes
12:05
Tech With Tim
Рет қаралды 590 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 821 М.
Why Is C SO Dangerous?  #programming #coding #lowcode
0:51
Low Level Learning
Рет қаралды 2,1 МЛН
Learn Python With This ONE Project!
55:04
Tech With Tim
Рет қаралды 1,7 МЛН
Python + JavaScript - Full Stack App Tutorial
1:29:25
Tech With Tim
Рет қаралды 181 М.
It’s time to move on from Agile Software Development (It's not working)
11:07