List Comprehension - BEST Python feature !!! Fast and Efficient

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии •

  • @patricklehmann24
    @patricklehmann24 2 года назад +52

    Using list comprehension for print is a very bad example. Compared to the the ordinary for-loop, an implicit list of return values from print is generated.
    Also the statement, that append(...) isn't used in list comprehension isn't true. It's not explicitly written as code, but somehow, elements need to be added to the list.
    The presentation states that some code is faster than other code, but no evidence is shown e.g. by using timeit.
    boolean values shouldn't be compared (==) with True. At first use "is True". At second, a call to the "is" operator can be skipped, because a boolean can be used directly in an if statement.
    Moreover there is no if-statement needed, as booleans can be directly converted to integers by calling int(...).
    list comprehension for strings ...
    I have no words how silly this is.
    ---------------
    Sorry, but such tutorials are the root cause for so many bad Python code in the world.
    Just because you can do it, doesn't mean you should do it; neither you should teach others !
    There are many good use cases for list comprehensions. There are also lots of use cases when list comprehensions are more compact, more readable and way faster than ordinary loops. But the given examples in this tutorial are neither.

    • @wanted4515
      @wanted4515 2 года назад +4

      Waited for such comment for a long time.
      You've summarized my thoughts in it as well
      Thanks 🙂

    • @PythonSimplified
      @PythonSimplified  2 года назад +208

      Thank you for the feedback Patrick! 😀
      I appreciate you taking the time to write this comment, I'll try to touch on all the topic you brought up even though I probably have much more to say hahaha (It becomes a bit philosophic towards the end, so I'm gonna keep it brief 😅)
      First things first - there's always a certain level of abstraction when trying to convey language concepts.
      Even my brilliant professors in university use examples that don't necessarily have real life applications and yet - demonstrate the subject really well. It's not an uncommon thing when you learn something new, especially when it's syntax related.
      In terms of the print statement - it's the easiest way to demonstrate how a block of code works. If you truly want to learn something step by step, this is the most logical place to begin with. It's quite obvious that printing list items is not the purpose of list comprehensions, and yet it demonstrates what's going on behind the scenes very well.
      In terms of the "append()" method, you can easily verify on your end whether your assumption is correct 😉
      For this, you will need a very long spreadsheet, in my case I'm using one with 34861 rows (called "ingredients.csv", in particular its "Ingredient Name" column. Please replace it with your own data as I can't share my file because it's part of my school project that is currently being graded):
      import time
      import pandas as pd
      data = pd.read_csv("ingredients.csv")
      my_list = list(data["Ingredient Name"])
      new_ingredients = []
      start = time.time()
      for i in my_list:
      new_ingredients.append(str(i).upper())
      print("for loop timing:", time.time() - start)
      start = time.time()
      fruits = [str(i).upper() for i in my_list]
      print("list comp timing:", time.time() - start)
      The results I'm getting on my end reflect a difference between both implementations:
      for loop timing: 0.004999637603759766
      list comp timing: 0.003046274185180664
      I ran it several times and list comprehension always has the upper hand (testing on an Intel Alder Lake 12th gen CPU).
      Now, please keep in mind that it's not a very big difference! but the longer your list is - the more it makes sense to avoid "append()".
      So just for the sake of the distinction - the "append()" method adds items to the end of a given list. It's very popular but there are different algorithms that can implement that.
      We know for a fact that the results are equivalent to a regular "append()" method - but we don't really know the exact algorithm used within the list comprehension given the difference in speed. It must be different, otherwise - it would have been reflected in the results.
      I actually found a very fascinating stack overflow post on the topic that you might enjoy 😊: stackoverflow.com/questions/22108488/are-list-comprehensions-and-functional-functions-faster-than-for-loops
      So my apologies for not including this timing code within the tutorial - I just rarely get requests from viewers to prove every word I say hahaha... it's not easy to cover concepts when you stop every 5 seconds to provide evidence... but I promise I'll take that into consideration in the future! 😁
      As my channel grows it brings a different type of audience - so of course I want you to be able to enjoy my videos as well. I just need to make sure it's not gonna upset my existing audience as they usually verify those things on their end, and often their conclusions are shared in the comments.
      In terms of the int() statement - I use it all the time, and you can checkout many other tutorials of mine to verify that! The only problem with your suggestion is - it defeats the purpose of this example as it skips the "if" and "else" statement I've been aiming to demonstrate.
      Boolean and integers were used to showcase that not only strings can be adjusted within a list comprehension, but the purpose of this example is the conditionals - not the conversion from boolean to integers... it just that at this point - I don't know if you're really providing feedback or just looking for things to pick on 😅😅😅 I fell like I'm feeding you with a spoon, even though I'm assuming you are well aware of most of the things I mentioned.
      Nevertheless, here's the last and ⭐ most important ⭐ part of my reply:
      From your perspective - I'm the root cause of all evil. But for other people - I'm the only reason why they have enough confidence to start coding. I simplify things so much that anybody can understand, regardless of their computer science experience or age.
      Programing doesn't come very easy for some folks. And I must mention that by using words like "silly" and "bad Python code" you are actually discouraging many passionate future developers who just happen to have a different starting point from yours.
      Those "best practices" we advocate for - is not something we get out of the blue - it's something we develop with time and experience.
      If you don't allow people to make their own mistakes - they will never learn. They'll just keep repeating what somebody else said without even knowing why. I don't consider this as "learning", it's more of "don't ask questions and do what you're told".
      You will never see things like this on my channel as it goes against everything I believe in.
      Trial and error is key, and the more examples you see - the better you get! Whether those are "good examples" or "bad examples" depends on specific situations and on the eyes of the beholder. There is no "one size fits all" universal coding standard and our industry is so dynamic that constraining yourself to a per-defined set of "dos" and "don'ts" limits your creativity and it assures that you will never ever innovate anything or discover something new.
      I find this approach very problematic, as what is silly to you - may be the perfect solution to somebody else's problem if not today - maybe sometime in the future.
      You obviously have some advanced knowledge in your field, but why don't you use it to motivate and encourage less experienced developers?
      There are plenty of professionals here in the comments providing help and advice to others, and I really think you'd be a perfect fit! 😀
      I would love to see you around despite our differences, I do enjoy reading viewer critiques and I think your comment is very important therefore I pin it 😉
      Cheers! and hopefully my you'll find my future videos a bit less problematic 😊 hahahaha

    • @yahgooglegan
      @yahgooglegan 2 года назад +2

      ​@@PythonSimplified From complexity point of view both are the same, however since Python is interpreted the more bullshit you write in your code the slower it goes.

    • @PythonSimplified
      @PythonSimplified  2 года назад +9

      @@yahgooglegan I'm a bit confused as to what you define as "bullshit" 😅... does it mean you're against list comprehension altogether? It doesn't seem to slow down anything - on the contrary, it's faster than traditional for loops (you can verify that with the code example from my previous comment).
      I don't know how this can be a bad thing... but maybe I'm missing something? 🤔

    • @yahgooglegan
      @yahgooglegan 2 года назад +17

      ​@@PythonSimplified "bullshit" = "verbosity". No, I'm not against i'm PRO, in fact you have proven your point very professionally and your tutorials are very good. What i wanted to say is that Python being interpreted (and dynamically typed ) will not optimize anything that you write as opposed to a C++ compiler. So even if you have 2 algorithms with the same mathematical complexity the one written with more instructions, function calls and variables will take more time to execute. This is also the case with append vs an optimized way like list comprehension. List comprehension is guaranteed to use the minimalist approach as compared to any verbosely written equivalent algorithm.

  • @PythonSimplified
    @PythonSimplified  2 года назад +37

    Thank you so much for all the lovely comments folks! I'm off to a Canada day camping trip deep in the wilderness, will catch up with all your messages once I'm back! 😃 (including on Twitter, LinkedIn and Discord 😉)

    • @Itsameemario
      @Itsameemario 6 месяцев назад

      what;s your onlyfans? we have AI to do coding now.....

  • @-gavgavgav
    @-gavgavgav 4 месяца назад +3

    Как же приятно, когда англоговорящий человек произносит все слова чётко и внятно.
    Частая проблема при восприятии носителей - зажеванные слова, проглатывание окончаний и нераздельная речь, звучащая как непрерывное заклинание. В этом видео шикарно всё!

  • @munivoltarc
    @munivoltarc Год назад +2

    One should learn from her how to teach to viewers or students offline or online, she got a gift of smile on her face, that makes her more beautiful in teaching, she is so passionate in teaching.

  • @katbryce
    @katbryce 2 года назад +37

    Some additional things I find useful:
    For more complicated list comprehensions, create a function that takes the list item as a single argument, and returns the result, then use that in the list comprehension in much the same way as you used print().
    If you have a really huge list, I sometime deal with lists that have 10m+ items in them, then instead of using list comprehension, use multiprocessing.Pool().map(function,list) to use all of your available CPU cores. This doesn't seem to work so well in Windows, but works very well in Linux and FreeBSD.

    • @PythonSimplified
      @PythonSimplified  2 года назад +6

      Awesome tip Katrina!! 😀😀😀
      Thank you so much for another insightful and super helpful comment! Pinning it to the top! (as usual 🤪)

    • @suvimpemel5583
      @suvimpemel5583 2 года назад +1

      Really useful information.

    • @Bruno-oj3zb
      @Bruno-oj3zb 2 года назад +1

      @@PythonSimplified Hello, Im new to python and I made a little script that automates keystrokes , only problem is it only works if the game window is up front, and I seem not to get it to work minimised , so I can use my PC while the script is running, for youtube for example , I tried : pyautogui, pydirectinput, pyautoit, AHK, But it seems Im to dum dum to make it work to send keystrokes Only to the game window . Can someone kindly guide me a bit. Thanks.

    • @V.Z.69
      @V.Z.69 2 года назад +1

      @@Bruno-oj3zb AHK should work. I use AHK all the time. Assign the macro to a key on the keyboard. Run the script.
      It's so easy. Use F5 to simulate "SHIFT + h"
      f5::
      send {Shift}+{h}

    • @magetaaaaaa
      @magetaaaaaa Год назад

      Is this just so the code is more readable? Wouldn't it be the same result in the end? Splitting it into a function and the list comprehension vs doing it all in list comprehension?

  • @americovaldazo6373
    @americovaldazo6373 2 года назад

    Python Simplified is the top python programming RUclips channel and Mariya is the greatest teacher of the world. Greetings from Argentina.

  • @MegaJohn144
    @MegaJohn144 2 года назад

    I have read and watched a lot of tutorials about Python list comprehension. This was the best. I think now I can write a list comprehension without copying somebody else's code.

  • @edderleonardo
    @edderleonardo 2 года назад +1

    This is the best tutorial about list comprehension, we need the dictionary comprehension

  • @guycostco7516
    @guycostco7516 2 года назад +9

    You are a life saver. It is so much easier learning Python with your fantastic tutorials. Keep em coming! Cheers from Montreal.

  • @Tooxcade
    @Tooxcade 2 года назад +7

    Absolutely a fantastic teacher. I like the way you explained it. Thank you!

  • @sasuke21153
    @sasuke21153 2 года назад +2

    I stopped using python for almost 2 months(not really long) but I was looking for some quick refresher with the language, and your videos really helped me a lot. I just want to say thank you so much!!!!.

  • @DerFlotteReiter
    @DerFlotteReiter 2 года назад +7

    I love how you edit your videos. Must be a lot of work but it pays off. Great to watch and learn!

  • @rahulkmail
    @rahulkmail 2 года назад +12

    Excellent. The way you covered the example's, just mind blowing.

    • @PythonSimplified
      @PythonSimplified  2 года назад +3

      Thank you so much Rahul! Super glad you liked it! 😁😁😁

  • @DonEdward
    @DonEdward 2 года назад

    This is EXACTLY what I need to get through a coding test! They asked to turn every other letter in a string from kwargs into upper, and every other lower. Thanks, Mariya! Perfect help, perfect timing!

    • @DonEdward
      @DonEdward 2 года назад

      I still have the problem of making each index (i % 2 == 0) for the .upper(). Then else .lower().

  • @patientson
    @patientson Год назад

    Your style of teaching is tremendously calming to mind, inner members and easy to grasp cause you add the extra effort to breakdown each step with mutual inclusive perspicuous/crystal clear processes. You understand the wisdom of patience of endurance and self-control in increase and kindness of absolute words of hope and encouragement.
    I may be very old than but I must say I love you, meaning i cant stop being explicitly patient and kind with my words toward you. I got this idea of love and trust in 1 Corinthians 13: 4-8 with Heading or subheading of ''the way of love.'' You solved a serious problem I was having in my mind - i had sleepless nights for close to one week trying to solve the PE1 Tic Tac Toe game.

  • @dae-182
    @dae-182 2 года назад +6

    Excellent! And yes, dictionary comprehension would be greatly appreciated.

    • @PythonSimplified
      @PythonSimplified  2 года назад

      Thank you so much Dan! 😀😀😀
      Dictionary comprehensions coming soon!

  • @igka4029
    @igka4029 2 года назад +5

    Спасибо, классная подача. Огромное удовоьствие смотреть такие туториалы.

    • @PythonSimplified
      @PythonSimplified  2 года назад +1

      Огромное спасибо
      Ig!!! 😀😀😀

  • @shaurryabaheti
    @shaurryabaheti Год назад

    I just used list comprehension for my huffman coding project, works so fast I love it!!

  • @pythondz7901
    @pythondz7901 2 года назад

    Mariya I had to watch the video twice. Because the serenity of your beauty made me lose focus 😅🤗 Thank you very much Mariya for the great content

  • @V.Z.69
    @V.Z.69 2 года назад

    List comprehension? Have you ever programmed in "Native C"? In C, we can create a "*.h" file and create definitions (header file)... It's very in depth. In short, you can create a "stub" for a "call function" or "call method" to shorten lines of code; rather than inserting popular function algorithms in each project. Even shorter, after building a "comprehensive list" of every-day functions you can just call the "function stub" (we say in C) and pass parameters and get the expected results (usually passing-by-reference to get a shorter and more expected result). Sounds like that's what Python is doing here. It's always good to know what's going on in the background. Great video!

  • @AlbertoNao
    @AlbertoNao 2 года назад

    I'm following you and watching your video to improve my Python, I'm using Py since 2 years every day with AWS-Lambda functions but there are always something new to learn! And you have an awesome voice so I improve my English too. Hello from Italy.

  • @TechieGuy82
    @TechieGuy82 2 года назад +2

    Brava Mariya 👏
    Subscribed :)

  • @vaishali985
    @vaishali985 5 месяцев назад

    Hi Maria, First time I have seen such dashing Python Trainer, you are simply mind blowing..

  • @adsolkz3853
    @adsolkz3853 2 года назад +1

    It's incredible!
    This is how programming should be taught.
    Mariya is a nice girl and explains about python in an interesting way
    Thanks a lot! I subscribed and like everywhere!

    • @PythonSimplified
      @PythonSimplified  2 года назад +1

      Yeeeyyy!! Thank you so much and welcome aboard!! 😁😁😁

  • @AlessandroGuarita
    @AlessandroGuarita Год назад

    Wow, RUclips just put this video in my timeline and I am very grateful. You didactic is awesome. It was an automatic subscription

  • @BintuChaudhary
    @BintuChaudhary 2 года назад +4

    I love the way you speaking with face expressions...

  • @ahmedelsayed3133
    @ahmedelsayed3133 2 года назад +1

    You make complicated things look easy. You are amazing!

  • @A1NTT
    @A1NTT 10 месяцев назад +1

    You are awesome. Such a great teacher!

  • @NitSarReb
    @NitSarReb 2 года назад

    I'm really happy that I found you channel. I learn a lot of topics in a really easy way. thank you so much dear. You are best in what you do.

  • @fedafedafeda5977
    @fedafedafeda5977 2 года назад

    You've done the entire course with much practical and super exiting way. so keep doing more videos and you are absolutely gorgeous!

  • @Slade1G
    @Slade1G Год назад +1

    I love your way of teaching, I understand it perfectly,

  • @jenschultz02
    @jenschultz02 2 года назад

    Thank you. This idea was breaking my brain. I don't understand completely yet, but I feel much better about it.

  • @hoochiecoochieman5505
    @hoochiecoochieman5505 2 года назад +1

    I'm here, trying to learn a bit so that I could code a program that'll handle some of the work I'm doing (hush, don't tell my employer) and I can't stress enough how helpful that was! Truly appreciate it! Cheers! 🍷🍷

    • @PythonSimplified
      @PythonSimplified  2 года назад +1

      hahahaha that's exactly what I found myself doing right after taking an introductory AI course - "how to make it seem like I do more - by doing so much less" 🤣🤣🤣
      Your employer might actually be very excited about it... purchasing software usually costs less than hiring staff 🤪

    • @hoochiecoochieman5505
      @hoochiecoochieman5505 2 года назад

      @@PythonSimplified I bet they would be happily pay a couple of months of my salary to a program that would do 75% of my job, which in my line of work (I'm an editor working for an agency and most of the time I check if everything's happening in time and just fix trivial mistakes the writers make) wouldn't be a huge problem for an intermediate programmer to do. 😁
      But I'd take what you say as an advice to "code a program that'll ease YOUR job, not your employer's". Hahahaha! 😋😋

  • @chrishabgood8900
    @chrishabgood8900 8 месяцев назад

    Thanks, for the tutorial, I am a ruby guy, but learning python. There is also the readability factor. sometimes doing the longer if else can be easier to interpret.

  • @barnabykent6698
    @barnabykent6698 2 года назад +2

    Always thought you had excellent teaching skills. The new slick look to these tutorials makes this the best place on the internet for (true) beginner Python instruction. Really looking forward to this channel going insanely viral in the future.

  • @alfblack2
    @alfblack2 2 года назад

    OMG! I have been struggling with this for a long time. And having a hard time to find documentation. Thank you teacher!! Teacher banana is looking extra pretty today. hehehe

  • @Xyquest
    @Xyquest 2 года назад

    She's the best at explaining. I love fruit.

  • @anitasunildesai
    @anitasunildesai Год назад +1

    Thanks a lot for the tutorial and you are exuberant. Love your teaching style too. Looking forward for more. 🙏🏼

  • @stan55ish
    @stan55ish 2 года назад

    'm very close to senior age I'm very thankful for your clear lessons

  • @lain_iwakura_ir1684
    @lain_iwakura_ir1684 2 года назад +5

    Thing I really like how you excited about what you interest in

    • @christopherb2246
      @christopherb2246 2 года назад +1

      It’s like she is Teacher kindergarten kids. It works for me.

  • @jlindsley9288
    @jlindsley9288 2 года назад +3

    Excellent tutorial. List comprehension is one of those things you think you understand until you try to explain it to someone. Always good to refresh your knowledge.

  • @simonchantack23
    @simonchantack23 2 года назад +3

    This was AWESOME!!
    I really like the way you simplified things. Great examples.
    Will love to see the same using dictionaries. Thanks so much!!

  • @ivankorobitcyn3310
    @ivankorobitcyn3310 Год назад

    Отличная подача, плюс практика английского! Так держать! Смело плюсую))

  • @dollysiharath4205
    @dollysiharath4205 Год назад +1

    Thank you - you're awesome at teaching.

  • @ZigBehaviour
    @ZigBehaviour Год назад

    Very clean and concise presentation - quality takes time, this took some time!

  • @mchess7157
    @mchess7157 2 года назад +2

    I've never come up with an idea to use list comprehension to manipulate strings. Nice and useful. As well as the way to use elif statement 👏

    • @PythonSimplified
      @PythonSimplified  2 года назад

      For a long time I've been manipulating strings with Regex or NLTK, so I really love the fact that you don't need to import any libraries to achieve similar results 😉I don't know if it's a better alternative, but I have a feeling it's worth testing it! 😊

  • @ioannp.5274
    @ioannp.5274 2 года назад

    Маша, спасибо, на вас всегда приятно посмотреть и послушать!

  • @susanthomas223
    @susanthomas223 Год назад

    Liked the way you explained it step by step and in depth

  • @Abdulbasittia
    @Abdulbasittia 2 года назад +2

    Your teaching is very clear, thank you so much 🙏

  • @aswinkumar4452
    @aswinkumar4452 2 года назад

    I recently automated some CSV processing using list comprehension to help out the support guys in my company. A cool feature to have for sure!!

  • @parulsharma390
    @parulsharma390 2 года назад +1

    This channel is a life saver 💕 thanks girl ✨

  • @christsciple
    @christsciple 2 года назад

    Some folks have pointed out improvements you could utilize in your code and the examples you use but I think it's fine to demonstrate basic Python functions and libraries in a video such as this. I've been programming and writing code since I was 11, I'm now 34 and have had titles such as "developer", "engineer", "architect", and now "entrepreneur". In my very humble opinion, you've done a great job at teaching the basics to folks who want to learn Python. You could always make follow-up videos demonstrating improvement on your code used in this video and discuss the "why" and "how" behind the techniques, but it's not critically important.
    Anyway, great video I really enjoyed it and always learn something new (or something I've forgotten previously!). Please, keep making videos and many of us will continue to support you!

  • @justiccoolman1816
    @justiccoolman1816 2 года назад +1

    For the camal case conversion instead of cutting off the first element at the end of the code: Skip the first element of the string before it is passed into the listcomprehension. And just concate the result to the first string element. So also a first lower letter will work.

  • @nachiketlokhande9306
    @nachiketlokhande9306 2 года назад

    Such a fantabulous teaching and teacher, very well done Maria

  • @borneoviral6379
    @borneoviral6379 2 года назад +1

    Thank you very much...it really change the way I code now. 👍👍👍

    • @PythonSimplified
      @PythonSimplified  2 года назад

      Yeyy! You're absolutley welcome! Enjoy! 😃😃😃

  • @vihansamvedi7939
    @vihansamvedi7939 Год назад +12

    Yeah, mom I am just learning python.

  • @seanquaint3258
    @seanquaint3258 2 года назад

    Very cool tutorial. Thanks. Nice shirt too. Happy Canada Day!

  • @blevenzon
    @blevenzon 2 года назад +1

    So much to learn so little time and brain. Thank you 🙏

  • @Canucs1
    @Canucs1 Год назад +1

    Thanks a lot Maria :) Love your videos. It was an awesome "list comprehension" explanation.

  • @gugl3x
    @gugl3x 2 года назад

    Great one! Can't wait for the dictionary comprehension.

  • @yoinkyboinky2450
    @yoinkyboinky2450 2 года назад

    I gotta say, bananayou taught me a great deal so far. Thank you

  • @karthikvenkataram4790
    @karthikvenkataram4790 Год назад

    Thanks Mariya. Am new to python coding and this video really helped me learn LIST COMPREHENSIONS.
    Just as a small input for all, regarding the example "MyNameIsMaria", we can use .strip() to remove spaces near double quotes.
    my_string_ = ("").join([' ' +i if i.isupper() else i for i in my_string]).strip()
    Please try and correct me if am worng.
    Thank you.

  • @colsadventures
    @colsadventures 2 года назад

    Thanks M. I found this from the dictionary comprehension video. Great work. Thanks again.

  • @williammonday9509
    @williammonday9509 Год назад

    Hi Mariya! Thank you for making the list comprehension tutorial. I was struggling with the concept.

  • @Gameplayer55055
    @Gameplayer55055 2 года назад +2

    the best thing in list comprehension is that we avoid big scary C fashioned for loops. in fact it is the same for computers, but it seriously enhances code readability for people

  • @fabio89ferreira
    @fabio89ferreira 2 года назад

    These tutorials are incredible!!

  • @M.I.S
    @M.I.S 2 года назад +1

    you're teaching is very good! thanks

  • @John-jr3zs
    @John-jr3zs 10 месяцев назад

    Love you videos! - thank you so much for making them :) - I always learn a lot from them!

  • @armoniapush8281
    @armoniapush8281 Год назад

    Thank you very much Mariya, you are a so great professor.

  • @ccuny1
    @ccuny1 2 года назад +1

    Brilliant explanation and examples for an old newb like me. This is so useful. Thank you. And yes please for dictionary comprehension.

    • @PythonSimplified
      @PythonSimplified  2 года назад +1

      Thank you so much Cricri! Super glad you liked it! 😀😀😀
      And also - Dictionary comprehensions tutorial is definitely coming soon!

    • @ccuny1
      @ccuny1 2 года назад

      @@PythonSimplified Good new. Thanks a lot.

  • @serta5727
    @serta5727 2 года назад +3

    Dictionary comprehensions sound Awesome! 🤓🐍 Up till now I only used list comprehensions

    • @PythonSimplified
      @PythonSimplified  2 года назад

      Will do! Dictionary comprehensions is officially on! 😉

  • @tomknud
    @tomknud 2 года назад

    Beautiful Mariya, you're a great teacher!

  • @undeadpresident
    @undeadpresident 2 года назад +2

    I just learned how to do for loops and this looks like a perfect next step. Yes I'd like to learn things with dictionaries too. I actually just made a little program that types back the keystrokes that you type into it with the same time intervals between keystrokes, so it types it back just like you typed it, and had to loop using both a list and dictionary to do it.

    • @PythonSimplified
      @PythonSimplified  2 года назад +1

      That's awesome, undeadpresident! 😀
      Sounds like a great way to add human features to bots - typing in random intervals to avoid detection (or pre-recorded in your case)
      Oh, and - Dictionary comprehensions tutorial is officially coming soon! 😉

    • @undeadpresident
      @undeadpresident 2 года назад

      @@PythonSimplified lol that wasn't exactly the idea I had in mind to use it for, but now that you mention it.....mwhahahahaaa!

  • @azhar145
    @azhar145 Год назад

    Awesome video. You made the whole concept so easy. Thank You.

  • @jamvin5647
    @jamvin5647 2 года назад

    I like this tutorial because it was easy to follow along and understand the basic ideas behind list comprehensions. This is the video I was needing, thank you!

  • @gokusupersaiyan6
    @gokusupersaiyan6 2 года назад

    I must admit that I initially watched one of your videos because you are a pretty girl and I wanted to see if you knew your stuff. Now I find myself watching them as soon as they come out. Your videos are very informative, very well made and a pleasure to watch. Good job!

  • @kevinhernandez6142
    @kevinhernandez6142 Год назад

    I really like the energy and positivity you transmit when teaching very usefull and interesting info. Kepping up María n.n Banananame XD

  • @sergemmol5357
    @sergemmol5357 2 года назад

    Damn, one of the best explained tutorial I've ever seen

  • @kevinmcaleer28
    @kevinmcaleer28 2 года назад +2

    Great tutorial, I'd heard of list comprehension, but hadn't really understood it until you explained it. I can't wait to start using this now!

  • @sadiqurrahman2
    @sadiqurrahman2 2 года назад +1

    Awesome. I request you for more videos on Python in this authentic method.

  • @vladyslavdotsenko1519
    @vladyslavdotsenko1519 2 года назад +1

    Very useful and easy to learn. Thank You very much.

  • @kosmonautofficial296
    @kosmonautofficial296 2 года назад +1

    Great video that string manipulation example was really good

  • @laurentm6330
    @laurentm6330 2 года назад +1

    Hi Maria, great tuto! Thanks from France!

  • @aasifkhan1545
    @aasifkhan1545 2 года назад +1

    This video really helps me a lot Thanks, I am really really curious about how dictionary comprehension
    , I'll be waiting for part 2

    • @PythonSimplified
      @PythonSimplified  2 года назад

      Thank you so much Aasif! 😁
      Dictionary comprehensions tutorial is coming soon!

  • @Nuohis13
    @Nuohis13 2 года назад +1

    Good examples and visualizations.

  • @2wheeled_photograph
    @2wheeled_photograph 2 года назад +1

    Thank you very much for the nice explanations. You help me to see things differently every time.

  • @rexsu9202
    @rexsu9202 2 года назад

    Love the way you teach ! Thanks !!!!

  • @joelsstuff8318
    @joelsstuff8318 2 года назад

    You’re hair was covering your maple leaves. So I didn’t get the “team eh” for a while. Funny.
    And nice graphics. Well done.

  • @Alikhan-ee7bs
    @Alikhan-ee7bs 2 года назад

    Please try to teach us new things in list comprehension however I like your teaching method and the smile on your face is very attractive for learning.

  • @Garycarlyle
    @Garycarlyle 2 года назад

    Education and beauty in one video. What could be better :)

  • @vaibhavsaran7124
    @vaibhavsaran7124 2 года назад

    A video on dictionary comprehension will be highly appreciated maam

  • @phovos7618
    @phovos7618 2 года назад

    Thank you! Your enthusiasm is encouraging and exciting. I hope to learn a lot more from you. Battle station is so on point. I bet you rack up the frags.

  • @joycebienheureux6892
    @joycebienheureux6892 2 года назад

    You're just awesome, wanna learn more from you.
    The explanation is really clear as a Cristal

  • @nodrogguod
    @nodrogguod Год назад

    Thanks Mariya, great video, easy to follow and apply.

  • @rugorg5487
    @rugorg5487 2 года назад +1

    Мария, прекрасно!)

  • @pierre2598
    @pierre2598 2 года назад

    Thank you Mariya, the structure of your video makes it easy to follow along, great work.

  • @chessketeer
    @chessketeer Год назад

    Thank you! You are a very good teacher👍

  • @dragangolic6515
    @dragangolic6515 2 года назад +1

    Браво Маша!

  • @cerealport2726
    @cerealport2726 2 года назад +1

    Excellent examples! I didn't know list comprehensions are generally faster!!
    If i'm writing code for people who are not familiar with Python (amazingly it is possible to know less than I do about Python...), I prefer using more lines to make the intent of the code clearer.

    • @lilDaveist
      @lilDaveist 2 года назад

      My own rule of thumb is to use indentation and for loops as soon as an else or elif is present. Sure, a List comprehension might be faster but the microseconds you earn aren’t worth the trouble you will have when you need to read the code some time later.

    • @cerealport2726
      @cerealport2726 2 года назад +1

      @@lilDaveist I would say i use a mix, depending on length. Multi-line comprehensions are indeed a nightmare to read.

  • @patricioa5535
    @patricioa5535 2 года назад +4

    Thank you for this fantastic tutorial. I would really like to see the Dictionary Comprehension version as well.