10 Python Tips and Tricks For Writing Better Code

preview_player
Показать описание
This video is sponsored by Skillshare. Be one of the first 500 people to sign up with this link and get 2 free months of Skillshare Premium:

In this Python Programming video, we will be going over 10 tips and tricks for writing Pythonic code. Here are the timestamps for each topic we will cover...
1) Ternary Conditionals - 0:34
2) Underscore Placeholders - 2:13
3) Context Managers - 4:25
4) Enumerate - 6:50
5) Zip - 8:52
6) Unpacking - 13:02
7) Setattr/Getattr - 19:08
8) GetPass - 26:24
9) Python dash m - 29:18
10) Help/Dir - 33:17

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python
Рекомендации по теме
Комментарии
Автор

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:

coreyms
Автор

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. :)

expat
Автор

Dude, underscores can be used to delim numbers!? Literally life-changing tip, thank you!

Demonslay
Автор

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)

BohdanKokovych
Автор

My favourite Channel for learning python

wolfisraging
Автор

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!

EVGrinds
Автор

As a Python beginner - but not a beginner in programming - this video was great! Awesome explanation, thank you!

brainplot
Автор

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!

petursteinn
Автор

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!

smashies
Автор

Corey, just thanks, man. That is all I can say for the content that you make here. I have learned so much from you

blazecoolman
Автор

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.

pawe
Автор

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.

isidaruk
Автор

Fantastic, 40 minutes of my life well spent.

archstampton
Автор

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

MegaTheDamir
Автор

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

sheeeeeeeeeeesh
Автор

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.

MyYouthUk
Автор

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!

hungvunguyen
Автор

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.

Bigbadwolf
Автор

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!

zperk
Автор

Those tips on unpacking were mindblowing to me; i never knew we could use those syntaxes. Great video!

caio-jlqw