Python 101: Learn the 5 Must-Know Concepts

2024 ж. 9 Мам.
1 025 502 Рет қаралды

See NordPass Business in action now with a 3-month free trial here nordpass.com/techwithtim with code techwithtim
If you're interested in becoming a developer that writes any type of code in python, then you need to understand these 5 Python concepts. In today's video, I'm going to break down 5 key Python concepts for any aspiring developer. Master Python, elevate your skills.
💻 Master Blockchain and Web 3.0 development today by using BlockchainExpert: 🔗 algoexpert.io/blockchain (Use code "tim" for a discount!)
💻 Accelerate your software engineering career with ProgrammingExpert: 🔗 programmingexpert.io/tim (Use code "tim" for a discount!)
🎬 Timestamps
00:00 | Introduction
00:38 | Sponsor
01:43 | Mutable vs Immutable
06:20 | List Comprehensions
08:22 | Function Argument & Parameter Types
14:44 | if _name_ == "__main__"
16:34 | Global Interpreter Lock (GIL)
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
👕 Merchandise: 🔗 teespring.com/stores/tech-wit...
📸 Instagram: 🔗 / tech_with_tim
📱 Twitter: 🔗 / techwithtimm
🔊 Discord: 🔗 / discord
📝 LinkedIn: 🔗 / tim-ruscica-82631b179
🌎 Website: 🔗 techwithtim.net
📂 GitHub: 🔗 github.com/techwithtim
One-Time Donations: 💲 www.paypal.com/donate?hosted_...
Patreon: 💲 / techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
- Tech With Tim
- Top 5 Python Concepts
- Master Python
⭐️ Hashtags ⭐️
#techwithtim #top5python #pythonprogramming

Пікірлер
  • Start your career in Software Development and make $80k+ per year! coursecareers.com/a/techwithtim?course=software-dev-fundamentals

    @TechWithTim@TechWithTim11 ай бұрын
    • Your timestamps are mislabeled for if_name and function types.

      @XrayTheMyth23@XrayTheMyth2311 ай бұрын
    • Hi Tim please make a video about GIL in Python and mulithreading in Python.

      @animeshmukherjee3676@animeshmukherjee367611 ай бұрын
    • what do you think about Mojo programming language

      @pinnaclemindset8985@pinnaclemindset898511 ай бұрын
    • please make a video about GIL and why does python not support multithreading

      @shashwatpatil4831@shashwatpatil483111 ай бұрын
    • Mojo programming language is super set of python and it is 35000x faster than python

      @aligharaibeh3761@aligharaibeh376111 ай бұрын
  • Working as a python dev and in my 1 year of practicing python... no one ever explained this well... you're a GEM TIM

    @Gaurav-gc2pm@Gaurav-gc2pm5 ай бұрын
  • The GIL can be bypassed by using parallelism which offers about the same capabilities as threads in other languages. This is more of a naming convention issue rather than an actual thing that you can't do in Python. Python threads are still useful for IO and similar async tasks, but they're simply not traditional threads. It's important to highlight these kinds of things even for beginners so that they don't go out into the world thinking that you can't do parallelism in Python. You absolutely can. It's just called something else.

    @TohaBgood2@TohaBgood210 ай бұрын
    • Hello dear sir, You mentioned that 'It's just called something else', and what came up to my mind is that another threading library named _thread which is meant for low level threading and also multiprocess library that allows users to run multiple python clients. Am I correct or did you mean something else?

      @umutsen2290@umutsen229010 ай бұрын
    • Thank you, that was a bit misleading. How can you do "multithreading" in python then?

      @Joel-pl6lh@Joel-pl6lh9 ай бұрын
    • @@Joel-pl6lh The library of choice for actual parallel processing in Python is _multiprocessing_ It has a similar interface, but gives you actual parallel computing on different CPU cores.

      @TohaBgood2@TohaBgood29 ай бұрын
    • ​@@TohaBgood2 That's what I found too, thank you because I'd have thought it's not possible. I wonder why he included this in the video?

      @Joel-pl6lh@Joel-pl6lh9 ай бұрын
    • Agree, in the GIL part of the video there is a lot of confusion since multi-threading is mixed with multi-processing, and not a clear definition has been provided, which contributes to confuse who approaches to these concepts. It simply does not exist a multi-threading code, in all the coding languages, that executes threads at the same time

      @ruotolovincenzo94@ruotolovincenzo949 ай бұрын
  • Because of the GIL, Python multi-threading is not useful for processor-bound computing, but it is still great for I/O bound computing (processor waits for input and output; example: disk read/write or networked data). Multiprocessing is a great way to get around the GIL, when you need to.

    @Gruuvin1@Gruuvin111 ай бұрын
  • At around the 4 minute mark you are confusing immutability with references. When you do 'y = x' what you are doing is assigning the reference of the object that x is pointing to, to y. When you assign a new object to x it drops the old reference and now refers to a new object, meanwhile y still refers to the original object. You use tuples in this example, but this is true for lists and dicts. When you change to lists, all you are really demonstrating is that x and y refer to the same object. With your get_largest_numbers() example, if you were to pass a tuple into the function you would get an AttributeError because you were passing an immutable object which doesn't have the sort method.

    @apmcd47@apmcd4711 ай бұрын
    • Thank you so much for correcting this section of the video. I hope enough people read this and try it so they can correct their understanding of the concept.

      @itsjaylogan@itsjaylogan6 ай бұрын
    • Isn't Python treat immutable types (strings, numbers, tuples) as literals, while lists and dicts are basically objects? Once you assign different value to a string or number or any other immutable type variable, you're actually creating another literal object, but the one you created previously still resides in memory and will be purged later, no?

      @eugeneo1589@eugeneo15896 ай бұрын
    • Yes, thank you. This kind of sloppy presentation should be career ending.

      @CliffordHeindel-ig5hp@CliffordHeindel-ig5hp6 ай бұрын
    • Actually, Tim was right and was pointing out the possibly-unexpected behavior one can run into with the behavior of mutable types: If you create x, create y with the value of x, and then REPLACE x by creating x again, then x and y will have different values. Try it yourself: x = [1, 2]; y = x; x = [1, 2, 3];print(x, y) If you create x, create y with the value of x, and then CHANGE x by reassigning one of its values, then x and y will have the same new value and the original value will be gone. Try it yourself:: x = [1, 2];y = x;x[0] = 9;print(x, y)

      @elliria_home@elliria_homeАй бұрын
    • ​@@CliffordHeindel-ig5hp your type of comment should be career ending 😂

      @jcwynn4075@jcwynn407518 күн бұрын
  • Absolutely brilliant for beginners. Crystal clear. I had countless errors due to the lack of understanding of mutable vs immutable variables

    @zedascouve2@zedascouve26 ай бұрын
    • I'm glad I stuck around; I had no idea about some of those other tips like in the function calls.

      @andrewcrawford2977@andrewcrawford2977Ай бұрын
  • This video made the concepts much easier to understand than others that I have seen. Thanks so much!

    @Scobbo@Scobbo9 ай бұрын
  • Please do a global interpretor lock, love your explanation style, clear and concise. Keep it up

    @pharrison306@pharrison30611 ай бұрын
    • this is just what ive been searching, please elaborate on python interpretor and how does it differ from C compiler, noting that python is developed in C.

      @adrianoros4083@adrianoros408310 ай бұрын
    • Please do this man!!!

      @phinehasuchegbu8068@phinehasuchegbu806810 ай бұрын
    • ​@@adrianoros4083 c compiler is very fast than python interpreter due to the defining of type of variable before compiling

      @xxd1167@xxd116710 ай бұрын
    • ​@@xxd1167bro you clearly have no clue what you're talking about

      @harrydparkes@harrydparkes8 ай бұрын
    • @@xxd1167 If you don’t know what you’re talking about, please don’t post anything. Stuff like this hurts those who are here to learn.

      @midtierplayer3890@midtierplayer38908 ай бұрын
  • I wanted to mention that the if name is main thing is frequently used for test code for libraries. Your code may have some functions to import elsewhere, then you can do examples in the main of how to use them, or try various failure cases, illustrate how to catch exceptions, etc. Also, to those getting into programming, please do yourself a favor and leave a comment in your code as to what it's for. The most likely person to be reading your code later is you, but if you wrote it 6 months ago, it might as well have been written by someone else, so be kind to yourself.

    @TonyHammitt@TonyHammitt10 ай бұрын
  • Great video! It might have been worth it to mention multiprocessing in Python as a way to overcome the multithreading limitation that you reviewed towards the end.

    @Raven-bi3xn@Raven-bi3xn11 ай бұрын
  • Dude!!! That was a great tutorial. There are so many "beginner" python tutorials out there and it makes it hard to find the more advanced ones. I learnt a bunch! Thanks!!!

    @craigsievewright@craigsievewright7 ай бұрын
  • Thank you so much. There is a lack of content on the internet about this. In addition to making things clear, it helped me in my programming midterm too.

    @MuhammetTaskin@MuhammetTaskin4 ай бұрын
  • Really quality content and you can see that Tim really put some effort in explaining things, making topics captivating, and clear. Thanks!!

    @Jose-di6wc@Jose-di6wc5 ай бұрын
  • Thank you you are right on point, we miss these understandings and start scratching our head when we get errors.

    @basavarajus2061@basavarajus206111 ай бұрын
  • Hi Tim, Great content as always. Would appreciate a separate detailed video on GIL

    @shaikhyusufniaz759@shaikhyusufniaz75911 ай бұрын
  • Certainly! In addition to multithreading, Python also provides the multiprocessing module, which allows for true parallel execution across multiple processor cores. Unlike multithreading, multiprocessing bypasses the limitations imposed by the Global Interpreter Lock (GIL) since each process gets its own Python interpreter and memory space. By utilizing multiprocessing, you can take advantage of multiple processor cores and achieve parallelism, which can significantly improve performance in computationally intensive tasks. Each process operates independently, allowing for efficient utilization of available CPU resources. However, it's important to consider that multiprocessing comes with some overhead due to the need for inter-process communication. Data exchange between processes can be more involved and slower compared to sharing data between threads within a single process. As a result, multiprocessing may not always be the best choice for every situation. To determine whether to use multithreading or multiprocessing, it's crucial to evaluate the specific requirements and characteristics of your application. If the task at hand is primarily CPU-bound and can benefit from true parallel execution, multiprocessing can be a suitable option. On the other hand, if the workload consists of I/O-bound operations or requires a high degree of coordination and shared state, multithreading might be more appropriate. In summary, the multiprocessing module in Python offers a way to achieve true parallelism by leveraging multiple processor cores. While it circumvents the limitations of the GIL, it introduces additional overhead for inter-process communication, which may impact performance. Careful consideration of the specific requirements and trade-offs is necessary to determine the most suitable approach for your use case.

    @mariof.1941@mariof.194111 ай бұрын
    • least obvious chatgpt user

      @nokken__1031@nokken__103111 ай бұрын
    • Certainly!

      @excessreactant9045@excessreactant904511 ай бұрын
    • @@excessreactant9045 Yes i using ChatGPT to translate from my Native Language in Englisch + I Used it to put more information in it

      @mariof.1941@mariof.194111 ай бұрын
    • 😂❤

      @flor.7797@flor.779710 ай бұрын
  • Some details skipped about *args and **kwargs: A forward slash "/" can be used to force parameters to be positional only, thereby making them required when calling and not by name. So, def function(a, b, /, c, d, *args, e, f = False, **kwargs) means a and b cannot have default values, are required to be passed when calling function, AND can't be supplied with their parameter names. e must also be supplied with a value when called. Naming the first * is not required. Doing so simply allows the function to take an arbitrary amount of positional parameters. def function(a, b, /, c, d, *, e, f = False) would require at least 5 arguments (no more than 6) passed to it: a and b are required, c and d are also required and optionally passed as keywords, e must be passed as keyword, f is completely optional, and nothing else is allowed. / must always come before *. * must always come before **kwargs. **kwargs must always be last if used.

    @zecuse@zecuse11 ай бұрын
    • thanks

      @timo_b3@timo_b311 ай бұрын
    • I didn't know the kwonly args after *args didn't need a default. The posonly arg names can also be used as kwarg keys when the signature accepts kwargs.

      @kmn1794@kmn179411 ай бұрын
    • you can also use "*" to force but I the more apt way is to use "/" I guess

      @user-sj9xq6hb9p@user-sj9xq6hb9p7 ай бұрын
    • Your description is accurate and provides a clear understanding of the use of /, *, and **kwargs in function parameter definitions in Python. Let's break down the key points: / (Forward Slash): When you use / in the function parameter list, it indicates that all parameters before it must be specified as positional arguments when calling the function. This means that parameters before the / cannot have default values and must be passed in the order defined in the parameter list. Parameters after the / can still have default values and can be passed either as keyword arguments or positional arguments. * (Asterisk): When you use * in the function parameter list, it marks the end of positional-only arguments and the start of keyword-only arguments. Parameters defined after * must be passed as keyword arguments when calling the function. They can have default values if desired. **kwargs (Double Asterisks): **kwargs allows you to collect any additional keyword arguments that were not explicitly defined as parameters in the function signature. It must always be the last element in the parameter list if used. Here's an example function that demonstrates these concepts: python Copy code def example_function(a, b, /, c, d, *, e, f=False, **kwargs): """ a and b must be passed as positional arguments. c and d can be passed as positional or keyword arguments. e must be passed as a keyword argument. f is optional and has a default value. Any additional keyword arguments are collected in kwargs. """ print(f"a: {a}, b: {b}, c: {c}, d: {d}, e: {e}, f: {f}") print("Additional keyword arguments:", kwargs) # Valid calls to the function: example_function(1, 2, 3, 4, e=5) example_function(1, 2, c=3, d=4, e=5) example_function(1, 2, 3, 4, e=5, f=True, x=10, y=20) # Invalid calls (will raise TypeError): # example_function(a=1, b=2, c=3, d=4, e=5) # a and b must be positional # example_function(1, 2, 3, 4, 5) # e must be passed as a keyword By using /, *, and **kwargs in your function definitions, you can create more structured and expressive APIs and enforce specific calling conventions for your functions.

      @hamzasarwar2656@hamzasarwar26567 ай бұрын
    • He definitely should've included this info in the video. I've learned this before but am not a professional programmer so haven't used it, so seeing it in this video would help non-experts like me. Also, this can be inferred from the explanations above, but maybe still worth stating explicitly: Parameters between / and * can be positional OR named. And the function won't work if * comes before /, since the parameters in between would be required positional and required keyword, which creates a contradiction.

      @jcwynn4075@jcwynn407518 күн бұрын
  • As usual, great work! Nothing fancy, well explained! Thx!

    @somongulmamadov3510@somongulmamadov351011 ай бұрын
  • In a long time, I kept thinking that multiple-threads speed up my process until I watch your video. Great video Tim! Hope that you will make a video about this crazy global interpreter lock.

    @vinhlo2637@vinhlo263711 ай бұрын
  • This is a great video for someone who is learning python as a second, third, or nth language. These are very python specific implementations of universal concepts and I had been wondering about their purpose when seeing python code.

    @yerneroneroipas8668@yerneroneroipas866811 ай бұрын
    • Should I be worried learning these concepts if I'm thoroughly learning Python as my first language? What should I look out for since I plan to move on to C++?

      @nicj_art@nicj_art7 күн бұрын
  • At around 11 mins another cool thing you could know mention is that if you provide a default variable that is mutable, say a = [], and say you modify the list to look like within the function to say a= [1,2,3], that default varraible is actually now a = [1,2,3] and could create problems if you call that function twice without giving the a argument

    @ireonus@ireonus11 ай бұрын
    • Can you clarify what you mean with a code example? I thought you meant this, but the default value doesn't change in this case (luckily, that would have been disastrous...) >>> def f(x,a=[]): ... print(a) ... a=[3,4,5] ... print(a) ... pass ... >>> f(9) [] [3, 4, 5] >>> f(9) [] [3, 4, 5] How would you make the default value change?

      @HerrNilssonOmJagFarBe@HerrNilssonOmJagFarBe11 ай бұрын
    • @@HerrNilssonOmJagFarBe yes, here you setting the value with the statement, , a=[3, 4, 5],which as far as I know is now stored at a different place in the memory but try instead by having your default value as say a = [1] and then in the function append a value to the list, something like, def add_item(a = [1] ): a.append(2) print(a)

      @ireonus@ireonus11 ай бұрын
    • @@ireonus >>> def f(x,a=[]): ... a.append(2) ... print(a) ... pass ... >>> f(1) [2] >>> f(1) [2, 2] >>> f(1) [2, 2, 2] Oh. Well, that's truly weird...! I also tried a recursing version of f() which made the issue even more spectacular. So 'a' is local to each particular invocation of the function, but the default value itself is the same across calls? What happens to the memory that's claimed by the default value once I've called the function too many times. There is no way to directly reference it outside the function. Can I ever reclaim it (short of redefining the function)?

      @HerrNilssonOmJagFarBe@HerrNilssonOmJagFarBe11 ай бұрын
    • f.__kwdefaults__['a'] I use this like f(x, *, _cache={}) but have not tested it across imports. Should probably fully understand the implications with good tests before using these for personal projects.

      @kmn1794@kmn179411 ай бұрын
    • @@kmn1794 Clever. It also made me understand the behaviour. Thanks! But such code seems obscure and abusive of that particular language quirk. How many would understand such code? I certainly wouldn't have until I saw this youtube vid.

      @HerrNilssonOmJagFarBe@HerrNilssonOmJagFarBe11 ай бұрын
  • HI Tim, Just getting into coding: as you know (motivation level throught the roof - then realise html is not a stepping stone but a foundation of things to understand) Well Done on your coding journey! 😅🧐💫💫

    @craigdawkins6943@craigdawkins694310 ай бұрын
  • Thanks for the video! Very consize and informative. The only thing that I would add about the GIL is that it because of it there are no performance advantages when it comes to so-call CPU-bound operations (like summation that was used as an example in the video). But when we are dealing with input/output-bound operations, such as sending a HTTP-request, then multithreading will improve performance, because instead of waiting for response before continuing executing code, we can use that waiting time to make more HTTP-requests. This can help handling multiple requests that are send to your web-applications, for example.

    @linatroshka@linatroshka11 ай бұрын
    • Hey Lina, i also have a django function on which request lands, it was giving timeout error when 2users were hitting the same fn using url, then i increased the gunicorn worker and now it's working fine. So my qn is, was that a good idea or there is any other way to handle concurrent request on prod. Fyi that fn involve hitting different tables, and storing bulk data in one of tables using orm. So if you can comment over this about the best way to handle these things. Kindly share.

      @shubhamjha5738@shubhamjha573811 ай бұрын
    • @@shubhamjha5738 Gunicorn is actually running your Django application on two different instances.

      @sahilkumar-zp7zv@sahilkumar-zp7zv10 ай бұрын
  • Interesting and amazing video, Tim. I’m currently learning Python and I was struggling with some concepts until I saw this! Simply thank you and greetings from DR 🇩🇴

    @JoanFernandez17@JoanFernandez178 ай бұрын
    • Ya tu sabe

      @hit7984@hit7984Ай бұрын
  • Great content. Keep it up. However, I believe there is a mistake at 3:34. You mention that we have some sort of automatic "copying" going on with "y = x" when using immutable types. This is actually not correct. The assignment still works exactly like with any other object - the reference x is assigned to y. Identifiers x and y are simply referring to the same 2-tuple object. After that, you change what identifier x is referring to (another 3-tuple) and print out the two individual objects. The identifiers are still references - even if using immutable objects.

    @koflerkohime2981@koflerkohime298111 ай бұрын
    • I might be dumb but don't you mean "x" instead of "y" here: "After that, you change what identifier y is referring to"

      @illusionofquality979@illusionofquality97911 ай бұрын
    • Came here to say the same. The point can be illustrated with this code, x and y point to the same thing: >>> x = 1 >>> y = x >>> print(hex(id(x)), hex(id(y))) 0x7f82aa9000f0 0x7f82aa9000f0

      @kungfumachinist@kungfumachinist11 ай бұрын
    • @@illusionofquality979 Yes, indeed you are correct. I have edited my comment.

      @koflerkohime2981@koflerkohime298111 ай бұрын
  • Thanks for clarifying these concepts Tim!

    @BillyT83@BillyT8311 ай бұрын
  • Thanks so much for so many useful videos. Can you please take some small Python projects and show the requirement gathering, design, and development of it?

    @jasper5016@jasper50168 ай бұрын
  • Great explanation style, thanks for your work!

    @andreibaditoiu@andreibaditoiu7 ай бұрын
  • Tim bro you never disappointed us ..This is straight up golden content...Really appreciate your work...Can we get more videos of you summarizing concepts in under 30mins once a month maybe ?

    @Imnotsoumyajit@Imnotsoumyajit11 ай бұрын
  • There is an error in the time stamps ,names of function arguments and if __ are interchanged

    @narutoxboruto873@narutoxboruto87311 ай бұрын
    • thanks, just fixed it :)

      @TechWithTim@TechWithTim11 ай бұрын
  • The explainer of mutable and immutable is really really clear, concise and useful...

    @carl2488@carl24883 ай бұрын
  • I am currently doing Python courses and i struggle a lot, i like that you distinguished parameters and arguments correctly and basically everything else what you've said is exactly the same things, that i got myself/what i've been told. But it is good to refresh upon those conceprts and methods to proceed with my further studying, because i when i am given a task almost everytime i find it hard to came up with the right solution and fail to get the right approach to it. Thank you for the video. Subscribed!

    @Eeatch@Eeatch2 ай бұрын
  • Great video/content, definitely want more informations/contents about GIL and multiprocessing in Python/Cython ;-) Thanks you for your work !

    @yoyonel1808@yoyonel180811 ай бұрын
  • Thanks. Most things I already know, so my takeaway: 1.) immutable types = C#/.NET valuetypes or Java primitive types, plain data types in C/C++, Pascal and mutable types = C#/.NET reference types or Java object types, C++ reference, dereferenced pointer data aka memory location in C/C++/Pascal/Assembler. 2.) List comprehension is reverted looping writing style (like perl?). 3.) Function arguments look similar to other languages here added dynamic argument *args and ** kwargs little bit like C's ... period argument and function. 4.) __name__=="__main__" unique feature? Easy, but unique, as I didn't saw dynamic caller backreference in another language. 5,) I thought GIL is about single threading

    @yutubl@yutubl11 ай бұрын
  • This helped me alot, thank you. What about multiprocessing though? I know it's not a standard module but it does say in the Docs that it does side step the global interpreter lock. I've been thinking of trying it out.

    @douglasgammill1842@douglasgammill184211 ай бұрын
  • This video has actually closed some gaps in my understanding of Python. It's truly a very cool and useful video, thank you

    @user-jc1xb7xr9u@user-jc1xb7xr9u5 ай бұрын
  • Great refresher been diging into C++ some time your forget the basics concepts great job thanks

    @triforgetech@triforgetech9 ай бұрын
  • Threading just takes advantage of GIL "idle time". (aka I/O wait-states) The Python "Multiprocessing" module allows you to run exclusive processes in multiple cores. (ie CPU-bound applications.). And (believe it or not) you CAN use threading inside an M/P function if it is coded properly. (according to the rules of MP functions and threads...)

    @johnnytoobad7785@johnnytoobad778511 ай бұрын
    • Yeah I was doing this on one of my projects and I'm surprised Tim didn't mention it in this video. Made it seem like you just can't do it at all.

      @LMProduction@LMProduction11 ай бұрын
    • Mojo will solve multi-thread problems in Python. Do you need something fast and it is Python? Mojo is the answer for you.

      @frostsmaker8966@frostsmaker896611 ай бұрын
  • I so much like the way you explained.. It's fantastic. and as well like your content, it's beneficial

    @alimihakeem841@alimihakeem84111 ай бұрын
  • thanks bro tim, love you for your time , you are a hardworking individual :)

    @hurtbadly2004@hurtbadly200411 ай бұрын
  • I appreciate the tutorial! Great job!

    @YonnBurgos@YonnBurgos9 ай бұрын
  • Thanks for the info as always! Really helpful

    @kashfox1050@kashfox10508 ай бұрын
  • Thanks a lot for this tutorial as improved my understanding a lot. Request to kindly upload more of these beneficial vedios. 🙏🏼🙏🏼

    @anitasunildesai@anitasunildesai7 ай бұрын
  • I appreciate the explanations, thanks for the video

    @willwidrick8039@willwidrick80398 ай бұрын
  • Incredible, love seeing your content. You inspired my learn a lot of my current programming knowledge and curiosity

    @garrettsmith315@garrettsmith31511 ай бұрын
  • This was simply phenomenal. Brilliantly done.

    @elliria_home@elliria_homeАй бұрын
  • Very useful video ❤ keep up the good work tim😊

    @kluchtube7042@kluchtube70428 ай бұрын
  • Hi, Tim. Learning lots of things from you! Many thanks from South Korea. Please make an entire GIL video!

    @user-mi2bb8bm6s@user-mi2bb8bm6s11 ай бұрын
  • Your'e True Legend for us as Python Developer! Thankyou

    @aribalmarceljames9908@aribalmarceljames99088 ай бұрын
  • When you do assigning one variable to another and the type is immutable, actually they store the refference to the same object ( I used function " id( ) " to check this out ), but than when you change the value of first variable the reference changes. idk

    @YevheniiMemruk@YevheniiMemruk8 ай бұрын
  • At 3:45 with: x = (1, 2) y = x you are not doing a copy, it is still an assignment to an immutable object. You can check it with: print(x is y) This returns True, meaning that both x and y are referencing the same object - a tuple (1, 2). And of course print(x == y) also returns True, as we are comparing an object with itself.

    @Pumba128@Pumba12816 күн бұрын
  • Thank you for this video! Very clear overview of important concepts in Python

    @raymondgrant2015@raymondgrant20152 ай бұрын
  • 3:50 It's also an effect of the fact that the file is read from top to bottom. Line 2 get the evaluated before a line you were to swap lines 2 and 4 with 1 anothen X would equal (1, 2, 3).

    @ventures9560@ventures9560Ай бұрын
  • I didn't know about the "GIL". Your explanation gave me the answer to a question that I had parked for some time: why did concurrency not speed up a specific function that processed a very large list? I hope this will be fixed soon.

    @danield.7359@danield.735911 ай бұрын
  • Your *args, **kwargs explanation was amazing... Positional Argument & Keyword Argument... You made it very very Easy to Understand the Concept❤️❤️

    @AnantaAkash.Podder@AnantaAkash.Podder9 ай бұрын
  • I get that there’s GIL and that python is a single threaded program, however I’m confused how the threading library is faster for I/O bound operations. I watched your video on threading and it was helpful, but I’m still a little curious what’s going on behind the scenes.

    @Nerdimo@Nerdimo7 ай бұрын
  • thank for sharing, this is very important to beginner like me.

    @Qbill0079@Qbill007911 ай бұрын
  • Multi threading is beneficial when your python program pauses or waits for the user to input something till then the GIL can be passed to another function and it can run that while its waiting for the user to provide the input

    @user-sj9xq6hb9p@user-sj9xq6hb9p7 ай бұрын
  • I am just learning Python and this video is VERY helpful. Thank you!

    @danuff@danuff5 күн бұрын
  • Thanks, I wasn't sure about the second to last and never heard of the GIL.

    @LudovicCarceles@LudovicCarceles11 ай бұрын
  • Very informative for beginners! Thanks you for putting this together!!

    @RAJAT2372@RAJAT237211 ай бұрын
  • Thanks Tim can you discuss the different libraries also I was told that if the code is made not to rewrite it. How can I go about finding these codes

    @jay8930able@jay8930able8 ай бұрын
  • I am always surprised how informative your videos are. I have a question, what's the point then to have multi threading in python if only 1 is being executed at a time ? Also Tim, I would love to see a video about top 5 useful algorithms in programming.

    @davdeveloper@davdeveloper11 ай бұрын
    • There are a few good answers to the in the comments 👍🏻

      @MSIContent@MSIContent11 ай бұрын
    • Threads occur concurrently, while processes occur in parallel. Threads are better for I/O bound operations while processes are better for CPU bound operations.

      @OM-xv5zx@OM-xv5zx11 ай бұрын
  • Thank you for the video! I find it very interesting how you show how to work with Python.

    @jesprotech@jesprotech6 ай бұрын
  • Thank you for your demonstration of mutable!

    @derickmcwilliams8089@derickmcwilliams80892 ай бұрын
  • Very informative, thank you!

    @markusobi4148@markusobi414811 ай бұрын
  • Bro, your videos are awesome! Thx

    @dragonsage6909@dragonsage690911 ай бұрын
  • this is gold! thanks!!

    @ankitasinha7892@ankitasinha78928 ай бұрын
  • So new to learning python, specifically for data collection and use in Marketing/Digital. My question between immutable and mutable would be use case. My assumption would be that you use a scraper etc. to collect data, then define that as an immutable data type, aka. store the raw data as a string. To manipulate/work with the data, you would then pass that string to a mutable data type, I'd assume a dictionary. From that, you can then pull sections of data, organise the data etc., and clean the data to be able to use it for statistics/interpretation. That way the original data is preserved and cannot be corrupted, but you're able to make as many copies of the raw data for whichever transformations you may need to make and use those different mutable copies for each required purpose. Would that be the correct thinking?

    @JustAGuyWithThoughts@JustAGuyWithThoughts10 ай бұрын
  • I would like to know more about the GIL! I love your videos because you distill the essence of what is important of these complex topics. I can say I have never fully understood the functionality of if __name__== __main__. I thought this was just something you do to initialize a class. Thank you for making this concrete.

    @chillydoog@chillydoog11 ай бұрын
  • Simple, but not always that clear like you explain it. Congrats and thanks!

    @chrisgalvez@chrisgalvez11 ай бұрын
  • 16:34 Sir, we can import concurrent.futures and multiprocessing modules for multiple cores and parallel executions.

    @justasydefix6251@justasydefix62517 ай бұрын
  • Fiiiiinally I understand those *args/**kwargs!!! Thank youuuuuuu!! 🎉🎉

    @yankluf@yankluf4 ай бұрын
  • Nice video, can you also make something like this but for the C++ program language?

    @TodiDiang@TodiDiang11 ай бұрын
  • That actually was really good thank you very much I just finished a code where it was "downloading 10 files at a time which is 10 times faster"... Now I understand why it doesn't work so well :')

    @earthslyrics@earthslyrics10 ай бұрын
  • Could you make an mutable type into a immutable type? I just started learning python a couple days ago so I’m still back at the very basics right now.

    @fpoddball@fpoddball7 ай бұрын
  • Thanks for the help TechWithJim!

    @iCrimzon@iCrimzon11 ай бұрын
  • Very good video, i am saving to see it one more time!

    @SimasAlan@SimasAlan11 ай бұрын
  • I'm not a Python developer, I'm an iOS developer (Swift, SwiftUI), I'd love to have people teaching new features on iOS with the same clear and concise speech as yours.

    @acjazz01@acjazz0111 ай бұрын
  • Thank you, I really appreciate this video. It has been really helpful to me on my Python learning journey. :)

    @xaviervillalobos3958@xaviervillalobos39582 ай бұрын
  • Another awesome py video thanks man!

    @cfwebdeveloper@cfwebdeveloper11 ай бұрын
  • Great video! Thank you!

    @itmanager1449@itmanager14498 ай бұрын
  • Thank you sir. You getting old😅 can remember your first pygame turorials i followed years ago. Wow Kudos sir keep it up!

    @Team-hf7iu@Team-hf7iu11 ай бұрын
  • I recently ran across *args, **kwargs in some code I was stealing, uh borrowing, and it might as well have said *abra **kadabra because I didn't really get how it worked. You made me understand. Thanks.

    @odarkeq@odarkeq11 ай бұрын
  • hello Tim, I have a question. Do you have any recommended courses for learning django or flask?

    @worldanime9884@worldanime988411 ай бұрын
  • this really helped me.

    @charlesdanamor3317@charlesdanamor33178 ай бұрын
  • 4:35 so is it accurate to say that when x was originally an immutable object like a tuple, and when assigning y = x, then x is passed "by value"? And when x was originally a mutable object like a list, when re-assigning x using y = x, then x is passed "by reference"?

    @RedShipsofSpainAgain@RedShipsofSpainAgain9 ай бұрын
  • thanks a lot super useful video. just to show nowarefuly we listen to you at around 1900 the sample given for parallel summary of 1..100 the narrative states if I sum from0 ..25 and from 25.. there shouldn't be overlap of 25 I think.

    @OggVorbis69@OggVorbis697 ай бұрын
  • Most important concept in programming: Boolean algebra. Many programmers do not get that right, but that is the basics of all computation.

    @What_do_I_Think@What_do_I_Think5 ай бұрын
  • Multithreading is highly advantageous for tackling large problems. I suggest creating a video to elaborate on its benefits for our audience.

    @raghaventrarajaram@raghaventrarajaram11 ай бұрын
  • thanks tim for sharing these

    @NicoAn2@NicoAn211 ай бұрын
  • the only thing i didn't know that you could put * before list or dic as arguments so i guess it was helpful

    @heco.@heco.10 ай бұрын
  • This is a good list. I would add generator functions.

    @JorgeEscobarMX@JorgeEscobarMX9 ай бұрын
  • Very informative video. Please make more videos on other important python concepts as well.

    @RDdggrd@RDdggrd11 ай бұрын
  • good video! I learned few new things. thank you.

    @leeamraa@leeamraa12 күн бұрын
  • Thumbs up. Tq Tim. Good tips.

    @kychemclass5850@kychemclass585011 ай бұрын
  • good stuff thanks, I'd love to see real life examples of when you would use *args and **kwargs for functions.

    @Master_of_Chess_Shorts@Master_of_Chess_Shorts11 ай бұрын
  • super useful thanks Tim

    @mkk-un9nz@mkk-un9nz14 күн бұрын
  • Your solution for if __main-- = "__main__" legitimately saved my sanity. I was working on an asynchronous endpoint function and i was having difficulty closing the event loop until using that worked!

    @Kiran_Nath@Kiran_Nath3 ай бұрын
  • I'm positive I've used multiprocess pools to get significant performance boosts while trying to do machine learning in the past..

    @NovaHorizon@NovaHorizon7 ай бұрын
KZhead