0:48 - The interactive shell (python -i file.py) 1:49 - Python Debugger (import pdb - standard library) 2:56 - Virtual Environments 4:19 - List and Dictionary comprehensions 6:34 - Lambda functions
@xle6ywek3454 жыл бұрын
thank you, nothing interesting
@bhuvanpatel48333 жыл бұрын
Thank you so much.
@inigo87404 жыл бұрын
This guy: pdb Me: print
@irend11634 жыл бұрын
def my_func(number): if number + 2 == 4: print("program is running baby") else: print("your code suck") my_func(2) Run the program, Your code suck Me : *what the hell happened here*
@OmarKhaled-ld5ur4 жыл бұрын
@@irend1163 you sure it didn't work cause i did the same and it worked
@irend11634 жыл бұрын
@@OmarKhaled-ld5ur it just joke man, of course it's a working code
@zyz11534 жыл бұрын
Inigo Diaz use pycharm to make it easier
@kanva44 жыл бұрын
@@OmarKhaled-ld5ur woooosh
@mateuszkolpa4 жыл бұрын
It's depreciated by PEP8 to assign lambda functions. They are mainly used for stuff like this: tuples = [(1, 5), (1, 3), (1, 4)] tuples.sort(key=lambda x: x[1]) print(tuples) OUTPUT: [(1, 3), (1, 4), (1, 5)] For 1 line functions do: def add(a, b): return a + b
@tobiaswegener12344 жыл бұрын
Interesting thanks for the info!
@TheJobCompany4 жыл бұрын
It's against PEP8 to not put a newline after a ":", so you would have to do it in 2 lines.
@TimoKvapil4 жыл бұрын
I know that this might be a stupid question for you (I AM A BIG NOOB) But is it possible to recreate this sorting thingy, without actually using lambda. I mean using only functions. (we can't use lambda at school)
@M15t4r1pP44 жыл бұрын
Timotej Kvapil Depends on what you mean. If you’re asking about sorting a list using the key parameter and a lambda, then yes, that is doable.
@soundcore1834 жыл бұрын
lambda can be used in commands for gui elements adding values without to specify a global function. Look at it like a list comprehension inside a function taking x and making basic operations without a function name. The difference to def i think it doesn't create an object or dict in general for exuting the function header like calling eval. Most of the object types in python are hidden dictionaries. Generators and annotators weren't mentioned.
@baphnie3 жыл бұрын
Don’t fall into the trap of rating code by counting lines (re: list comprehension). Your code ought to be efficient, but MUST be readable. The best code is that which future peers can read reasonably quickly.
@saminchowdhury79954 жыл бұрын
Production quality is amazing. Thank you brother.
@phoehtaung4 жыл бұрын
For those asking what font Dank Mono What IDE/Text Editor? VSCode What theme? Material Theme
@MrChickenpoulet4 жыл бұрын
Hey thanks for that
@zephyr74 жыл бұрын
I was just gonna ask that
@linusbrendel4 жыл бұрын
Thank you very much ♥️
@InarusLynx4 жыл бұрын
A man after my own heart. A man of culture and fine taste. Excellent choice for theme.
@LavakeshPandey4 жыл бұрын
Dank Mono costs £40.
@berkaykurkcu4 жыл бұрын
For Windows 10 using PyCharm with Python 3.7.6 , when you initialize a virtual environment "virtualenv venv" in PyCharm Terminal on your project, new folder containts "Include,Lib,Scripts,tcl and Readme.txt" , no /bin/. What you can do is cd to Scripts and then just type "activate" . should do it.
@givdb55133 жыл бұрын
Excellent vide, better than the majority of KZbin videos. What I really need actually for now it's a complete semantic, syntax explanation of Python and languages in general
@CordonbleuZz4 жыл бұрын
List comprehensions are very powerful! i've seen it in Haskell (functional programming language) where you could write quicksort in 2 lines
@chaddaifouche5363 жыл бұрын
List comprehension actually originates from Haskell, Guido was inspired by its syntax (and adapted that to Python). Of course list comprehensions in Haskell have their origin in set comprehension in Mathematics.
@bradylange3 жыл бұрын
This is extremely useful! I develop a lot with Python and had no idea about the interactive shell or the Python Debugger. Thank you!
@TubularAnimator2 жыл бұрын
I love your channel. Been subscribed for a long time.
@AaronJack2 жыл бұрын
Thank you so much!
@claymcclendon4 жыл бұрын
I am taking a python class rn and this is extremely helpful! Wish I knew this a couple weeks of ago.
@antoniofuller23313 жыл бұрын
Lol
@8ctrl7634 жыл бұрын
The editing and the content is absolutely amazing (P.S - need more videos like the tinder bot may be post a building a bot or something once a week)
@gabrielh51054 жыл бұрын
Wow, the edition of this video is incredible. The transitions, the camera, the light, the animations, wow. You have escalated a lot. From English teacher, passing through software developer, to a great content creator. Keep it up.
@sausas8209 Жыл бұрын
I agree! Quick intro, cool but not too long or annoying splash, to the point tips and great screen capture only containing the necessary information !
@andre-barrett4 жыл бұрын
Awesome tips and tricks. I'm not a Python developer but I've been a software engineer for 20+ years. Let's keep sharing the knowledge
@ahmedalgrai4 жыл бұрын
I'm just glad that I found this channel.
@mikeblijd3 жыл бұрын
For real for real
@FrootNinja4 жыл бұрын
Your production value in your video has gotten better I love the new setup
@tmiae04 жыл бұрын
Great video, keep 'em coming!
@bikerkid9754 жыл бұрын
Loving the increase in video efficiency and overall creativity and style. Keep it up! Cheers from Montréal
@marcoscz78584 жыл бұрын
Amazing, strait to the point videos. Keep them coming!
@gulshankumar174 жыл бұрын
wow, thanks man. Python is really great. Yesterday I was given some excel sheets to work. Instead of doing it manually I use python pandas library.
@irend11634 жыл бұрын
What do you need to do with excel sheets? And how do you work it automatically with python?
@AU240972 жыл бұрын
@@irend1163 he’s probably reading the excel sheet and converting it into a pandas dataframe.
@grantwilliams6304 жыл бұрын
I’d recommend conda environments over virtualenv if you plan on using math or statistical libraries anyway. Conda’s numpy installation comes with Intel’s MKL and is worth using
@sasukesan964 жыл бұрын
You are my favorite youtuber, thank you so much for teaching us all that stuff. This channel is truly underrated.
@masthanjinostra29814 жыл бұрын
Its overated or underrated?
@riteshbhartiya61554 жыл бұрын
You made my life so easy, and effortless 🎶
@wouldbealex4 жыл бұрын
anaconda with a jupyter notebook makes debugging in-line. Then the code can either be run externally against the notebook or export the code to a py script. Conda also allows for multiple environments. With each environment, the developer can install whatever is best or required for that environment (e.g., _r-mutex and r-base in one env and Microsoft MOR in another without conflicts between libraries/packages. Otherwise, great starter video. Dictionaries or any other form of collection that can be traversed without array interactions is really important in all languages. Lamda and filter are great!
@JayTeaFTW4 жыл бұрын
For sure my new favorite channel
@igorthelight3 жыл бұрын
Just remember guys: less code != cleaner code
@vinni1132 жыл бұрын
Really great video! I've been using python for a while but learnt some new things so thanks!
@jrwkc4 жыл бұрын
bruh, ya using VSCode and then also using pdb inside of it. That's putting a hat on a hat. The debugger in VScode is life changing.
@somiljain76704 жыл бұрын
Thanks! for sharing these tips :)
@lpdc97674 жыл бұрын
Very good quality and channel consistency. Thanks for the tips.
@_gpop4 жыл бұрын
List comprehensions changed my life. I should probably be working more in virtual environments though.
@dimitrisfloroskoufis_98662 жыл бұрын
Good evening. I would like to ask how did your journey as a front-end programmer start? What does one need to do not in terms of knowledge. I try to get acquainted with programming but I can not understand it. I feel like I know nothing while I have been studying for hours!
@atrus382323 күн бұрын
Good list, though I find I pretty much never end up using lambdas. The syntax is so verbose, and not that clear, and for most list operations, a generator expression is shorter and clearer. For example (x for x in [1, 2, 3] if x > 1) is clearer and actually shorter than filter(lambda x: x > 1, [1, 2, 3]). I tend to only use map and filter with regular def functions that are already defined.
@felixk21293 жыл бұрын
Awesome, thanks a lot!
@紺野-純子3 жыл бұрын
for the pdb you can replace it with breakpoint() instead
@JulienReszka4 жыл бұрын
Not even 2 minutes of video and already learned something great. Thanks
@kaczordonald14264 жыл бұрын
I learned something new. Thanks!
@depressedknight3693 жыл бұрын
this is really so helpful, always. Whether I revise things just for my knowledge sake or preparing for an insterview, I go through this video for sure.
@dinesh.p86423 жыл бұрын
your voice is nice and smooth. You are a legend!
@FernandoOrtega104 жыл бұрын
Strings have the startswith() method to check the first letter. And you can also do set comprehensions, which use the curly brackets just like the dictionary comprehension.
@Francois3k4 жыл бұрын
Were did u go learn all your animation you put in the videos? cause it looks firee. If you can, can you tell me what courses you use an the resource cause that would be awesome 😊😊😊
@hkn55393 жыл бұрын
Awesome. Thanks bro.
@jaykim71614 жыл бұрын
Thank you Aaron
@iliqnew4 жыл бұрын
5:29 I think there is a more simple way. list(fruits.keys()) list(fruits.values())
@RiedlerMusics4 жыл бұрын
yes, he just wanted an example to show how list comprehensions work.
@clarianken42234 жыл бұрын
@Iliyan what is that technique called? pls explain how it works?
@eesakamaldien19174 жыл бұрын
Just subscribed. This video is so helpful
@mike_kravchenko4 жыл бұрын
WHAT IS INSIDE OF FOLDER "RUSSIA"?
@sickofit13044 жыл бұрын
I want to know that too..
@UlfKlose4 жыл бұрын
It says “RussiaN”. I guess he’s learning the Russian language or something.
@skynet10244 жыл бұрын
maybe its how to ask for mercy in russian (if ww3 happens)
@Turco9494 жыл бұрын
It will be in another video.
@shayantej6514 жыл бұрын
Russian Nuclear Hacking codes😂😂😂😂
@toyomade Жыл бұрын
Whelp… as I transition from SQL heavy work into data analytics/data science and try to add Python to my skill set, I see exactly how far I have to go lol Every journey begins with a single step, off we go! Thanks, I’m sure I’ll be back (with context) so that this will make sense
@kalanachamath Жыл бұрын
Thanks man!
@shivams4174 жыл бұрын
comprehensions and lambdas, filters, map are usually ignored in python, which actually very useful if used in right ways. Useful video man, keep em coming ! Thanks
@avinashtammali61304 жыл бұрын
thats quite helpuful mate thanks
@raf61254 жыл бұрын
Thank you. This was really useful
@douglasm14944 жыл бұрын
Thanks for the tips Shaggy
@Shadowhuntazz4 жыл бұрын
As a python beginner, this is a nice and truly useful vid man, thanks 😉
@Circumvenscion4 жыл бұрын
Love your vids man. Great tips, thank you!
@oliverzhang61024 жыл бұрын
Thanks a lot! That's very useful!
@emperorscotty4 жыл бұрын
i need to start coding now that i went over all the basics
@illmar10374 жыл бұрын
here is good tip for you, make the window full screen so the code do not get cut off. also keep your voice consistent, do not mumble.
@tucan13093 жыл бұрын
i just wanna say u could have your life way easier if you used pycharm debugger, also u would also have way easier time with venvs and installing packages
@bendirval36122 жыл бұрын
Just use breakpoint() instead of importing pdb using set_trace(). No importing necessary.
@luis96xd4 жыл бұрын
Thanjs for all this tricks and tips!
@muhammadahmedjaved76914 жыл бұрын
Your videos are always very awesome and informative I always watch whenever they are released a lot of people don't yet know how good you and your video are you will get a lot of subscriber in near future if you continue to produce these awesome videos
@melboom29944 жыл бұрын
I tried the first tip, but it doesn't seem to work for me...... my terminal looks different that yours
@anaximeno3 жыл бұрын
Usefull for sure!
@jacksontaylor32204 жыл бұрын
Great video Aaron! Will you be continuing your data structures series soon?
@AaronJack4 жыл бұрын
hey Jackson, I'm continuing the series but don't think KZbin is the right place for it (algorithm didn't like it). So I'm working on 20 data structures and algorithms videos for a course right now. It will be fully animated and have both JS and Python versions.
@jacksontaylor32204 жыл бұрын
Code Drip That’s awesome, totally understand. If you’re looking for people to beta test the course I’d love to check it out while you’re working on it
@AaronJack4 жыл бұрын
@@jacksontaylor3220 sure, would be great to have some feedback, could you send me an email and I'll send you a link? (codedrip4@gmail.com)
@nmtechie40334 жыл бұрын
Very useful tools. Thank you so much.
@rudithboii874 жыл бұрын
I’m a python beginner coding on Mac OS. What program are you using to code python? Currently, I’m using a text editor (sublime text) and then using IDLE to run my code. I also don’t like using IDLE because it’s not that convenient as sublime text. It’s not very efficient because I have to keep switching back and forth. The program you’re using seems to do everything.
@JakeCallahan4 жыл бұрын
Use vscode. iirc it is available for Mac as well. With the extensions, it is the best free editor/idea imo. Also, if you're experimenting with python, use ipython instead of the idle. Ipython is much nicer!
@CODTALES-KILLSTREAKS4 жыл бұрын
Hahahahahah thank you 🙏 you made my whole week Code Drip!
@matrixv014 жыл бұрын
Awesome videos. Keep it up!
@ragnarok79767 ай бұрын
The cursive font gave me flashbacks to grade school
@activestate4 жыл бұрын
Great pdb tip!
@juhof.734 жыл бұрын
Sorry but could you please make the editor full screen so we could see the full code at once. You have the the full 16:9 screen but your editor 1/3th of it.
@refaiabdeen59434 жыл бұрын
Cheers Mate !
@NicklasBekkevold4 жыл бұрын
Hey, nice video! Your VScode looks great, which theme / fonts are you using?
@jursamaj4 жыл бұрын
Lambdas are OK for a quick and dirty one-off function passed to another function. If you use it more than once, probably better to make an actual function.
@fcmorena2463 жыл бұрын
nice tutorial, expects more
@codecat84304 жыл бұрын
Great stuff!
@MrEcksan4 жыл бұрын
Great, thanks!
@TechPravinya4 жыл бұрын
👍 Good job. Nice presentation and content.
@catfan56183 жыл бұрын
Nice VS Code setup. Which font are you using?
@nikluz38074 жыл бұрын
Damn this is my fav new channel
@TheGagi824 жыл бұрын
Can you tell me since i want to learn Python and i am beginner,which os is better for me at start: Mac os or Linux based os ? Please,give me straight answer between those 2 options,thanks ahead.
@thesam7234 жыл бұрын
The lambdas and sort function is good for data science as it's a more functional approach to programming
@depressedknight3694 жыл бұрын
and thanks a lot for this...it was nice
@mbonuchinedu24204 жыл бұрын
indeed, its gonna be around for a verrrry long time
@fusrusty2534 жыл бұрын
Well done!! Love your videos!!
@zephyr74 жыл бұрын
If u like his font its called dank mono but its not free, if you want a free font similar to it then i suggest Victor Mono
@alikaperdue Жыл бұрын
@4:58 -> perl doing python list comprehension @fruit_names = map($_->{name}, @fruits); Syntax is a little different, but the meaning is the same. Perl can collect data from structures in one line too and before python. Data structure would be nearly the same: @fruits = ( { name => 'apple', price => 20}, { name => 'avocado', price => 10}, { name => 'orange', price => 5}, ); For only fruits beginning with "a": @fruit_names = grep(/^a/, map($_->{name}, @fruits)); For a new dict using names as keys and prices as values: %new_fruits = map(($_->{name},$_->{price}), @fruits); Perl is old stuff now, but it had some cool features. I'm glad to see Python implementing and improving on Perl ideas. But "list compression" is just a name for something that appears in other languages without the moniker. Or it exists in Perl without an official name. We called these things: "one liners"
@jonathanrodriguez12334 жыл бұрын
Is that sublime? and if so can you do a tutorial on how to get that terminal and how to make it look like that? Or maybe a link if you have one. Thanks!
@irend11634 жыл бұрын
It's VSCode, a code editor same like sublime, it's open source and developed by github VSCode come with built-in terminal CMIIW he use material theme
@rogercheng12944 жыл бұрын
Thanks a lot !
@EchoVids2u4 жыл бұрын
I still don't understand why we should use virtual environments. Why is it useful? Why not just use the system environment.
@ebentee4 жыл бұрын
Thanks for sharing my bro
@hermesmercuriustrismegistu48414 жыл бұрын
Amazing videos!
@dwsonye3 жыл бұрын
Kind of a plub question, I have my network+, security+, as well as Azure Admin and AWS practitioner, my question is I want to learn Python to get my feat wet but which one? P2 or P3?
@10OzGlove4 жыл бұрын
00:19 "Learning on the job is the best way to learn and I do firmly believe that", I'm sure you don't believe in it anymore when you're dealing with someone who's learning on job through the mistakes they're making at your expense...
@fullsleevetats4 жыл бұрын
> I'm sure you don't believe in it anymore when you're dealing with someone who's learning on job through the mistakes they're making at your expense... That's what code reviews and peer mentoring is for.
@pauldudley12733 жыл бұрын
why is a virtual environment better than using docker?
@robertwallace54984 жыл бұрын
thank you for these tips :)
@tee91204 жыл бұрын
Another cool vid, thanks bruh
@jordanrenaud71894 жыл бұрын
A trick similar to the first one is to import your other programs and then call the functions like, import main; main.add(1, 2)
@Kinos1412 жыл бұрын
other 'programs' are called classes, if I'm not mistaken.
@jordanrenaud71892 жыл бұрын
@@Kinos141 This was a while ago I wrote this, but no I wasn't referring to OOP (object-oriented programming) if that's what you're thinking. I meant something more along the lines of writing and importing your own modules/libraries. This could definitely involve importing classes from other files, although I'm not sure I'd necessarily call these "programs" in and of themselves, more like components of a program. Instead of typing something like 'python -i main.py' to enter the interpreter, you can just enter the interpreter normally and 'import main.py' (the same way you would import any other module/library, like pandas, numpy, or os). It's just another way of doing the same thing; although I believe you have to be in the same current working directory as that file (main.py) or else specify the path in your import statement. I love the modularity of it because you realize you can write your own libraries/tool kits. You could define all your classes in one file and import/use them in the main program if you wanted (separation of responsibility, adding another layer of abstraction). I'm not a software engineer though, so I can't speak to best practices. I'm sure someone more familiar with OOP will correct me. I'm a data analyst and tend more towards functional programming. Again though, classes are components of a program. You still need to instantiate them to use them. They are not programs in and of themselves. You define a class and then create an instance of that class (an object), from which you can define it's attributes and call it's methods. I believe this is how it works anyway. Python is multiparadigm though, so you can do OOP, functional, procedural/imperative, or a combination depending on your style or use case. For example, ML (machine learning) tends to blend OOP and functional programming (the popular ML libraries are OO but the code written to implement them tend to be functional). If anyone knows better, please keep me honest. I'd hate to misguide anyone :-P