To save you time, I put a list of all of the tips and the timestamps for each in the description of the video. And again, this video was sponsored by Skillshare. If you'd like to check out Skillshare with 2 free months of Skillshare Premium, you can use my link here: skl.sh/coreyschafer
@knownwolf5 жыл бұрын
Thank you for the timestamps!
@mrityunjayahiremath39515 жыл бұрын
Hey Corey, please make a video on MRO (Method Resolution Order) in Python
@almohtarifchannel67025 жыл бұрын
Corey Schafer how we can loop 2 lists witout same lenth
@coreyms5 жыл бұрын
Like I was saying in the video, zip will stop after the shortest list is depleted. zip_longest from the itertools module will go to the end of the longest list and have filler values for the shorter lists. Watch my video on itertools to see an example.
@dharaneeshwaranravichandra61595 жыл бұрын
Please make a video on "How Django processes a request ?"
@expat20103 жыл бұрын
I'm 79 years old, been studying Python for about 6 months, and I got to tell you I get so damned exited with the stuff I learn from you - no other teacher, paid or free, has come close. I just hate to tear myself away from videos like this! I don't have a lot of money, but I'm gonna send you a few bucks - buy a toy for your beautiful dog. :)
@deeshu34563 жыл бұрын
God bless you... ☺️✨. Shine on...
@tobycherry473 жыл бұрын
@@joshkanyinda5569 tf is wrong with you. he's doing whatever he wants, making the most of life, unlike you obviously.
@cloakedvisor3 жыл бұрын
@@joshkanyinda5569 What a useless comment...
@ididntgetthejoke35873 жыл бұрын
@@cloakedvisor agreed
@pillowrabbit83243 жыл бұрын
tf is wrong with you
@BohdanKokovych5 жыл бұрын
Enjoy! 1) 0:34 - ternary operator ; 2) 2:13 - Underscores in Numeric Literals + about f-string; 3) 4:29 - context manager ; 4) 6:49 - enumerate function ; 5) 9:01 - zip function ; 6) 13:46 - unpacking tuples (use asterisk and underscore); 7) 19:11 - getting and setting attributes to object (setattr, getattr ); 8) 26:24 - getpass instead input (read from keyboard) ; 9) 29:22 - run python with dash m in terminal (python -m ...); 10) 32:32 - built-in functions (help, dir etc)
@eujnia4 жыл бұрын
loviuuuuuuuuu
@ardonjr4 жыл бұрын
@@eujnia This is literaly in the description
@eujnia4 жыл бұрын
@@ardonjr can u act like a normal person and just ignore me?
@za66044 жыл бұрын
@@ardonjr Mobile users can't click the timestamps in the description.
@ardonjr4 жыл бұрын
@@za6604 Uh yes I can? I'm typing this from my mobile phone..
@Demonslay3355 жыл бұрын
Dude, underscores can be used to delim numbers!? Literally life-changing tip, thank you!
@MykhailoK-sh6sm5 жыл бұрын
Same XDDD
@zahirjacobs7165 жыл бұрын
only python 3.6+
@elghazouanimohammed66395 жыл бұрын
Can you give me an exemple where you need that please ?
@Demonslay3355 жыл бұрын
@@elghazouanimohammed6639 I deal with cryptography and thus large numbers a lot. Having some human readable constants is nice, such as 2**32 if it were written out. Sometimes it even just helps for understanding "oh, it's like a billion" without having to break out the cursor to count each zero.
@bsmaheshkumar53285 жыл бұрын
It is used to separate the multiple string. Ex. full_name = 'John'
@wolfisraging5 жыл бұрын
My favourite Channel for learning python
@medi75735 жыл бұрын
And best on KZbin
@sandeepvk5 жыл бұрын
Indeed ! he is quick to the point and no baloney
@vorrade3 жыл бұрын
@@dr.rijjaayaz8160 Sorry, but the narrative voice is not nearly as pleasant as Corey Schafer's
@EVGrinds4 жыл бұрын
I've been coding in Python over a year now, and was expecting to only see one or two new things. BUT I LEARNED SO MUCH MORE ! Thank You!
@brainplot5 жыл бұрын
As a Python beginner - but not a beginner in programming - this video was great! Awesome explanation, thank you!
@petursteinn97185 жыл бұрын
Your content is so unbelievably good! Thank you so much for all that you've taught me. You speak so clearly, describe concepts so well, demonstrate with perfection, you're incredible!
@coreyms5 жыл бұрын
Thanks!
@isidaruk14085 жыл бұрын
The work you do is priceless. Thank you so much, Corey! You are really wonderful teacher, who keeps to inspire me and others to move toward being a better developers.
@coreyms5 жыл бұрын
Thanks for the kind words!
@blazecoolman5 жыл бұрын
Corey, just thanks, man. That is all I can say for the content that you make here. I have learned so much from you
@coreyms5 жыл бұрын
Thanks for the comment! Glad you've learned a lot!
@MegaTheDamir5 жыл бұрын
Was sitting yesterday, passing values to object attributes(13of them), and ended up looping around dict and doing this: For item in dict: obj.attribute=item[‘index1’] obj.attribute2=item[‘index2’] Wish I knew about setattr... Thank you !!!Mr. Schafer
@archstampton59105 жыл бұрын
Fantastic, 40 minutes of my life well spent.
@smashies1185 жыл бұрын
Wow. Figured I'd watch a random python tips video instead of memes and found exactly what I needed for one of my projects. Thanks man! Awesome vid!
@pawe14 жыл бұрын
His tutorials are exponentially much better than most of the Udemy & Coursera courses. You're doing a Great job Corey you're having an impact ❤️ Keep it up.
@realchrishawkes5 жыл бұрын
Great video, thank you for sharing!
@toptoendgamer73603 жыл бұрын
I watch your videos
@misterjaypeasmith3 жыл бұрын
Praise from Caesar 😅
@Bigbadwolf1443 жыл бұрын
Thank you for this trick, this is just I was looking for, and thank you for screen size, because there are tons of videos, where I can't see nothing, but your is great, thank you my friend.
@hungvunguyen89295 жыл бұрын
As a new Python learner, I find your videos are the most interesting, clear and throughout! Glad that you still making python videos. Thank you!
@sheeeeeeeeeeesh5 жыл бұрын
IDK how but I have been using python for about 2(ish?) years now and most of these are brand new to me and HOLY CRAP DO THEY CHANGE SO MUCH
@jerrymiller15904 жыл бұрын
You are the best teacher ever Corey! Learning tips and tricks like these can save a programmer a lot of time, so I really appreciate videos like these
@vaibhavkrkm4 жыл бұрын
Yea👍
@MyYouthUk3 жыл бұрын
This is the first time I've intentionally sat through the sponsor segment at the end of a video... not because I'm interested in Skillshare... just because you've more than earned that time from me.
@nasreddinehodja59305 жыл бұрын
KZbin : 10 python tips and tricks... Me : Leave me alone please KZbin : ...from Corey Schafer Me : *Instaclick*
@coreyms5 жыл бұрын
Haha, thanks!
@antonlashov78935 жыл бұрын
Hey, Corey! Greetings from Mother Russia 👋🏻 Thank you for what you are doing! No water, just a facts with super clear examples. You’re making KZbin better!
@kumarmayank85865 жыл бұрын
The best python teacher ...thanks corey sir..
@stephenneiswanger4827 Жыл бұрын
This guys knowledge completely blows other tutorials out of the water! I know I’m late to the game Corey but your content is truly amazing thank you from 2023
@caio-jl6qw5 жыл бұрын
Those tips on unpacking were mindblowing to me; i never knew we could use those syntaxes. Great video!
@flavio49232 жыл бұрын
The best programming teacher I've found in KZbin!
@zperk135 жыл бұрын
I've been coding with python for a while, I've messed around with neural networks, yet somehow I didn't know some of these amazing tips. Thanks!
@md.akib51245 жыл бұрын
day by day I am falling more and more in love with your teaching style
@TAlfonsoK5 жыл бұрын
Your videos are amazing. So well explained. I feel I learn to code better every time I watch your videos, even if I already know the modules you introduce. Thank you so much!
@Jokeofdday4 жыл бұрын
lot of people know python but only few knows how to tech or deliver it.. 👍 best free python tutorial available across youtube and internet..
@williamreames22284 жыл бұрын
Although I didn't know about zip (8:52) and it does seem pretty helpful, it looks like you could get an equally organized structure if you use a dictionary instead since the two lists are inherently related and do something like: for name, hero in dictionary_name.items(): In any case, great video and I definitely managed to learn some things
@kaitoti213 жыл бұрын
feels good to know some of this already as a somewhat beginner
@o.sunsfamily4 жыл бұрын
Reading about those things (as someone who started with C and co) it's easy to forget. This video is a great summary of all the helpful functionalities we forget about.
@pedro_69252 жыл бұрын
The quality of this content.. insane. Thanks, Corey.
@Ridistrict5 жыл бұрын
Thank you for everything you do, Corey. Once again, I've learned an absurd amount of information in less than an hour.
@unclebuddy2 жыл бұрын
Corey is a genius at knowing what it is we need to know and knowing how to explain it simply and clearly.
@santiagolerin4 жыл бұрын
First of all, I have to say that I'm very thankful for this videos. I am from Argentina and the part of "nosetuid" made me laugh a lot just because I instictibly separated it like "no se tu id" witch is Spanish for "I don't know your id"; I know, is silly, just wanted to share it with the comments people
@csathys24 жыл бұрын
Hi Cory, just a few minutes into this video, your first 2 tips, use of ternary condition and enumerates, led me to come up with this class that would pretty much "act" like a substring on a list of elements. For example, if you wanted to just extract certain elements of a string. Full code is here: class mylib(): def __init__(self, list_a, start, end): self.list_a = list_a self.start = start self.end = end def getSubset(self): names = self.list_a en=enumerate(names) startpos=self.start endpos=self.end c=[] # initialize a new list for idx, name in en: # Append only if our criteria is satisfied. c.append(name) if (idx >= startpos and idx
@ItzSenaCrazy5 жыл бұрын
Dude!! What a great video! Thanks you so much. Please, continue bringing more videos
@I_Follow_Jesus5 жыл бұрын
I'm just getting started by taking a couple online courses. Your videos really help to clarify the subject matter. You have the best Python videos on KZbin.
@coreyms5 жыл бұрын
Thanks! Good luck getting started in programming!
@AlexanderDemin5 жыл бұрын
A tip about unpacking with the star is great. Thanks a lot.
@vaibhavkrkm4 жыл бұрын
36:49 U accidentally delivered one more tip than you said (at least for me), u typed exit() to exit Python from terminal, while I used to import sys first from os, and then do sys.exit().. Thanks, you are one of the best teachers for me!!!👍🤗
@dmenace92885 жыл бұрын
Thanks mate. You just saved me tons of hours of hating myself. Great job!
@uzeyir.suleymanov Жыл бұрын
Thanks a lot Corey - 3+ years and it helps 🙌 At 12:30 we can use: for index, (name, hero, universe) in enumerate(zip(names, heroes, universes), start=1): print(f'{index}: {name} - {hero} - {universe}')
@computer_sciences5 жыл бұрын
Thanks Corey your channel isTHE best Channel for learning python please if it possible a playlist for Data structure & Algorithms in python
@dudang58145 жыл бұрын
Just FYI, the underscore number separator only available from Python v3.6+
@climatechangedoesntbargain91405 жыл бұрын
...
@ReddoX304 жыл бұрын
Thanks for pointing that out!
@ricardocebreros71423 жыл бұрын
Also the f string place holder It was added with v.3.6 Older versions have to use “ “.format()
@ddffdf49373 жыл бұрын
man you just saved my life my python code will be a lot cleaner going forward
@brightsideofmaths5 жыл бұрын
And I am still learning new cool stuff you can do in Python :) Thank you!
@gussta14 жыл бұрын
I know this is an older video, but I found it really helpful. I'm pretty much making all the programming mistakes you're talking about....now I'm cleaning them all up...thanks.
@ishpeace48865 жыл бұрын
You are the best as usual Corey. Thank you so much for this valuable tutorial, you are really a life saver
@antonlinden52165 жыл бұрын
Brilliant tips for typing code with high quality! New to Python! But i worked as a developer for a company for 1 year with AngularJS, I wish people cared more about this type of things! Thanks!
@RufusVidS3 жыл бұрын
I've worked with Python for many years, and some of the features mentioned here are only in the most recent versions of python (like f-strings). I work in environments that have older versions of python (even the now obsolete Python2.7) without these features I think it would have been helpful if the version of Python where the feature was introduced was mentioned in the video. This is not meant to be a criticism, this video is great!
@matthewweitzner89563 жыл бұрын
I clicked on this video thinking I would learn one or two things, but I've been shocked and impressed by each tip, this was very helpful!
@oj430855 жыл бұрын
Nice video... I didn't know about the start in enumerate. And that unpacking list bit was really good.
@WandererOfWorlds04 жыл бұрын
I've worked with Python for a few years and have seen a lot of code out there but I didn't know all of the tips here. Thanks.
@caseymccray38615 жыл бұрын
Your videos are so high quality! All the info was very useful specially the dir(). God I wish i knew that earlier xD Thank you so much :) I followed your django tutorials and now have 4 good personal projects under my belt! Your tutorials were my foundation of Django. One thing I'd really want you to cover is unit tests. They seem to be a huge part of companies and I think its an important topic to cover and would be helpful to other viewers as well. Thank you so much once again for producing such high quality videos for us
@jaideepshekhar46215 жыл бұрын
Yes, what are unit tests?
@bengbeng20054 жыл бұрын
so far, this is the best python channel i ever saw, best explanation, clean nice voice, thank you mr Corey
@jingyuchang18855 жыл бұрын
Great tips and tricks! The best python instructor!
@JamBear4 жыл бұрын
This is incredible. I absolutely love your delivery - you are such a good speaker. I've used your videos as a refresher and I want to thank you so much for your great archive of helpful videos!
@AundreL5 жыл бұрын
The package "Terminus" is a package that allows you to run the command line as a panel in sublime text 3. I personally use it in combination with WSL on my windows pc to simulate a Linux setup without having to run a VM.
@thingsiplay4 жыл бұрын
Before I started the video I saw the 39 min length and thought, well okay give it a shot for 10 minutes and then scroll through. 10 minutes later I realized its 39 minutes later. Very sweet, thank you.
@minghaotao62595 жыл бұрын
Best Python Learning Channel!
@betaman20095 жыл бұрын
Excellent video. I learned some of these the hard way writing spaghetti code and I think it's refreshing to have a breakdown with examples like these. Great work!
@eeshsingh33365 жыл бұрын
Hi, can we please have tips on how can we make our code more reusable and understandable if we're working on a large scale project? Thanks. As always, the best tutorials on YT!
5 жыл бұрын
Comment your Code and split your Code into small classes and files
@zentraidee97012 жыл бұрын
The best tips and tricks for all coders!
@jamesjung44405 жыл бұрын
thanks for the free knowledge, from an aspiring developer
@Mamuli_283 жыл бұрын
ur accent is very easy to understand and calm! easily understood everything u taught!
@aasensios4 жыл бұрын
from my_heart import thank thank.you('for this brilliant and plain way of explaining python usage')
@garybloomlaw4 жыл бұрын
Regarding 'zip'... In conjunction with slices, it's a great way to "pair up" elements in a list or tuple. So, if you have nums = (0, 1, 2, 3, 4, 5), you can use zip(nums[::2], nums[1::2]) to get ((0, 1), (2, 3), (4, 5))
@anilkumarverma2405 жыл бұрын
Hey! Corey that was great video tutorial . Get to learn lot of new things. Happy Pythoning.
@mikasaackerman67805 жыл бұрын
I just solved a problem using zip thanks to this video. Thank you..
@spitalhelles33805 жыл бұрын
only 4 minutes in and I went off a wikipedia binge tangent that left me knowing everything about large number names in different scales and languages
@thengakola62174 жыл бұрын
I usually dont see videos longer than 30 min....... But this was worth it
@starecekmichal5 жыл бұрын
Great video! Many thanks. Strong emphasis on the statement: You don't have to know everything, but it's more important to be able to find information and use it.
@siberianwolf7774 жыл бұрын
Thank you Corey! Probably, anybody would like to use that case: 1) there is you can get the object: attributes_holder = type('attributes_holder', (), {}) 2) there is you are ready to init the object attributes. Corey described this. (setattr, getattr functions)
@parkeranderson234 жыл бұрын
maybe this is just me being crazy, but i ALWAYS do loops like this: for i in range(len(names)): print(i, names[i]) but idk
@Bryan-bh7cy4 жыл бұрын
nub...
@jankreitzscheck99144 жыл бұрын
So do I. I'm not a professional programmer, this works for me, no idea whether it is the ideal way of doing things.
@ycliu40464 жыл бұрын
This would be faster than enumeration. You could timeit yourself. I would prefer this one to enumeration
@krishnakumarshankar45764 жыл бұрын
Why can't you do this
@SorinOltean774 жыл бұрын
@Parker Anderson: your method is correct for sure but is not pythonic. The Python way of doing things tends to simplicity in code writing, hence the enumerate function. Even the fact that you can loop through a list with just "for item in items:" is something really easy to write and understand later.
@rasmushopland50014 жыл бұрын
Thanks a lot. Jumped from JavaScript to Python due to University class, and i must admit I hate some of the differences. This helped a lot
@ghazanfarabidi41375 жыл бұрын
Great flow dude..
@arizu1240 Жыл бұрын
how do you explain that functions so easy? im having a hard time with that before with some guys here in yt but you teach me that in 3mins lol. thank you, what a madlad
@pepinote145 жыл бұрын
Wait, Clark Kent is Superman?? no way, I've seen him, he weares glasses...
@negarshahrokh97274 жыл бұрын
Thank you very much for sharing this, as a data analyst using python on a daily basis some of these would make my life a lot easier! :D
@kantulaev5 жыл бұрын
VEry cools zip tips
@g3org32104 жыл бұрын
Corey, wanted to give a like for every tip&trick out there... Thanks a bunch!!!
@westfield905 жыл бұрын
I appreciate your videos. But there are 4000 KZbin videos on fundamentals of python, however only about 5 on how to solve issues. When I take a class or an interview they ask me to solve a problem and not syntax questions. I wish there were more videos on how to solve problems so I can see how the logic works and how to approach solving the problem.
@teja05054 жыл бұрын
I must say you 've provide very handful tips. After seeing this video I'm going to change my coding style. Your tips are certainly going to save lot of time.
@sadbadmac4 жыл бұрын
These are like the new 10 commandments
@somjji3 жыл бұрын
Thank you so much for setattr and getattr. It is amzing. Changed my whole codes.
@cybergen2K5 жыл бұрын
You were sent from heaven.
@gregtuve11095 жыл бұрын
Impressed with your concise, well organized and illustrated approach to python, I signed up for skill share. Afterwards, I couldn't find your name no matter how I searched for it. It didn't save me any time at all. Instead I decided to subscribe to your youtube channel. I think markets like udemy and skillshare are the wave of the future, but clearly skillshare has a way to go. You should have gotten credit for my sign up automatically--and not just with some puny commission--but in skillshare's recommendations.
@kickflipz3 жыл бұрын
"Not all python modules are this thicc." Oh just like how not all youtube videos are this thicc? 🙂
@thewhiterabbit6613 жыл бұрын
You got the best tutorials i have found so far thanks for the good work man
@rohan3525 жыл бұрын
Will u make a vid on tkinter or any other GUI?
@azr_sd4 жыл бұрын
we need part2 Corey..It's really an awesome video.. Waiting eagerly for part2,3,4,5, --- infinity .. :) Keep posting awesome stuff Corey.
@TinkCSA5 жыл бұрын
nose tuid xD. Exactly the way I read it as well the first time.
@pythonprojectsforwindows67955 жыл бұрын
Tip for OOP __iter__, __next__ methods and StopIteration class rangep: '''Pure Python sequence type container. Version 1.05 index starts at 0 Replaces builtin range() type constructor''' def __init__(self, stop, start=0): self.stop = stop self.start = start def __iter__(self): self.count = self.start return self def __next__(self): if self.count < self.stop: next = self.count self.count += 1 return next else: raise StopIteration container = rangep(1_000_000) for item in container: print(item)
@coreycarter56685 жыл бұрын
Have I told....you lately....that I love you? Hahaha
@shazkingdom17025 жыл бұрын
hahaha... he deserves the song... 🎶
@study-channel63014 жыл бұрын
Wow, I can't believe KZbin may have such talented and amazing instructors who CLEARLY impart what they know. Kudows.
@jaymeetvasava76684 жыл бұрын
"nose tuid" I am gonna remember it this way now. 😂😂😂😂
@datboi_gee4 жыл бұрын
Quick question. Still super new to Python. I haven't been in the dev game for roughly 10 years and Python is my first and only experience with an interpretive language. All prior experience was within the Visual Studio .NET framework, specifically with the languages VB & C#. Firstly, I absolutely LOVE Python. Like too much. It feels like how programming was always meant to be. Anyway: though I have significant experience in other languages, this is my first time taking the self-taught approach to learning a new language. Besides that, its been nearly a decade since I did any legitimate writing. So I'm coming at this from a fresh perspective. I can see these techniques being useful. Even when you were explaining advanced unpacking techniques, I can still see the utility. I adore the utility of the zip function and the enumerate function. I love the ability to set and get attributes on the fly. And though not all techniques are useful at all times, that's just the way programming is. Some use cases are much more narrow than others. My question is this: is there a specific resource online somewhere that has quick categorized access to all of these niche functions hidden within Python? I'm still not quite familiar with modern programming community tools like GitHub or Stack Overflow or Jupyter, etc. And I'm still not entirely grounded in Python enough to know what libraries are critical, what libraries are superior, what is and what isn't within the core Python library, the utility of Anaconda or Iron Python, etc. Still soaking up new information. As it stands I have no problem writing quick effective scripts in Python but when it comes to pre-built, pre-packaged utility, I don't know where to look and why. So if anyone has pointers for specific tools and use cases for them, I'd very much appreciate it. Phenomenal video, btw. Much love.