10 Python Tips and Tricks For Writing Better Code


[ad_1]

This video is sponsored by Skillshare. Be one of many first 500 individuals to enroll with this hyperlink and get 2 free months of Skillshare Premium:
https://skl.sh/coreyschafer

In this Python Programming video, we will probably be going over 10 ideas and methods for writing Pythonic code. Here are the timestamps for every matter we are going to cowl…
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 sprint m – 29:18
10) Help/Dir – 33:17

Context Managers Tutorial – https://youtu.be/-aKFBoZpiqA
Sys.path Tutorial – https://youtu.be/CqvZ3vGoGs0

✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/be part of

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

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

✅ Corey’s Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/store/coreyschafer

▶️ You Can Find Me On:
My Website – http://coreyms.com/
My Second Channel – https://www.youtube.com/c/coreymschafer
Facebook – https://www.fb.com/CoreyMSchafer
Twitter – https://twitter.com/CoreyMSchafer
Instagram – https://www.instagram.com/coreymschafer/

#Python

supply
[ad_2]

Comment List

  • Corey Schafer
    November 8, 2020

    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:
    https://skl.sh/coreyschafer

  • Corey Schafer
    November 8, 2020

    Python Programming is just Amazing !!! You can do a lot of exciting scientific things with Python ..
    Learn Python with my Free and Convenient Live YouTube classes every week . SUBCRIBE to my YouTube channel @UCFwaG_bEHxzhl-mRwvzYDqQ and start learning this exciting language and improve your skills.
    I will conduct classes on Python – numpy , scipy , matplotlib, gnu plot , numericals etc .
    Coding will be done in IDLE shell and SPYDER .
    Thank you All …
    Victoria Mam 🙂

  • Corey Schafer
    November 8, 2020

    Python Programming is just Amazing !!! You can do a lot of exciting scientific things with Python ..
    Learn Python with my Free and Convenient Live YouTube classes every week . SUBCRIBE to my YouTube channel @UCFwaG_bEHxzhl-mRwvzYDqQ and start learning this exciting language and improve your skills.
    I will conduct classes on Python – numpy , scipy , matplotlib, gnu plot , numericals etc .
    Coding will be done in IDLE shell and SPYDER .
    Thank you All …
    Victoria Mam 🙂

  • Corey Schafer
    November 8, 2020

    I think you are using the term 'code smell' very liberally. What deep problem is there in closing a file yourself?

  • Corey Schafer
    November 8, 2020

    a day to remember

  • Corey Schafer
    November 8, 2020

    fantastic tutorial

  • Corey Schafer
    November 8, 2020

    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!

  • Corey Schafer
    November 8, 2020

    What does the "f" in print(f'{name} is actually {hero}') do?

  • Corey Schafer
    November 8, 2020

    Great stuff! Thanks putting it al together.

  • Corey Schafer
    November 8, 2020

    Python is so simple that you need 3 diffrent functions to replace (int i = 0; i++; i<x)

  • Corey Schafer
    November 8, 2020

    The best python teacher …thanks corey sir..

  • Corey Schafer
    November 8, 2020

    I wish I can watch this video again and again everyday. Thanks a lot Corey Schafer

  • Corey Schafer
    November 8, 2020

    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!

  • Corey Schafer
    November 8, 2020

    I was proud that I knew much of this, but Corey expands even on some things I thought I knew! Although in the context manager section he uses file reading as an example, another shorthand to read a file into a buffer is one-liner:
    file_contents = open('test.txt','r').read()
    which will do the same thing, including closing the file.

  • Corey Schafer
    November 8, 2020

    Excellent tips! Appreciate and Thanks, Corey, although I a year later :(, Could you tutor IoT's, such as How to upload data to Clouds (e.g. IBM Watson, BlueMix) , send email/SMS in concise python.

  • Corey Schafer
    November 8, 2020

    Great techniques

  • Corey Schafer
    November 8, 2020

    This is pure gold!

  • Corey Schafer
    November 8, 2020

    Very useful

  • Corey Schafer
    November 8, 2020

    great tips and tricks

  • Corey Schafer
    November 8, 2020

    Last Tip was the Best

  • Corey Schafer
    November 8, 2020

    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

  • Corey Schafer
    November 8, 2020

    Thanks a lot for making this video!

Write a comment