Komentáře •

  • @katbryce
    @katbryce Před rokem +53

    In the DNA example, to simplify the code, I would create a dictionary:
    pair = {"A":"T", "C":"G", "G":"C", "T":"A"}
    Then, instead of the nested if statements, do
    dna = {key:[val, pair[val]] for (key, val) in enumerate(strand1)}

    • @JorgeEscobarMX
      @JorgeEscobarMX Před rokem +3

      Agree, I felt a little excesive use of ternerary operatrors.

    • @colinclarke3338
      @colinclarke3338 Před rokem +1

      I think it should be .. pair[val]] .. but could be wrong.

    • @katbryce
      @katbryce Před rokem +1

      @@colinclarke3338 Yes it should, I've edited it now. 😳

    • @PythonSimplified
      @PythonSimplified Před rokem +12

      Wow!! This looks awesome Katrina!! Great job! I love it! 😃😃😃

    • @aldolunabueno2634
      @aldolunabueno2634 Před rokem

      I've done it in a similar way:
      dna = {idx:[b, {'A':'T', 'T':'A', 'C':'G', 'G':'C'}[b]] for (idx, b) in enumerate(strand1)}

  • @owoled282
    @owoled282 Před rokem +3

    The level of polish of the channel in general is really appreciated , thanks for sharing your knowledge !

  • @tomislam
    @tomislam Před rokem +17

    The 'key' to learn dictionary comprehension is to practice this 'value'able exercises in this video.

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      hahahaha that was very poetic, Tom!! 😁

    • @tomislam
      @tomislam Před rokem

      @@PythonSimplified Thank You 😊

  • @mikepenprogrammer2652
    @mikepenprogrammer2652 Před rokem +4

    Many thanks for the great content. This should be archived for future data analysts and pythonistas.

  • @_isDev
    @_isDev Před rokem

    Amo a esta mujer! Enseña muy bien!

  • @tortugatortuga7505
    @tortugatortuga7505 Před rokem +2

    I'm using this to teach a student about dictionaries, thank you!

  • @sachindeshpande1
    @sachindeshpande1 Před rokem

    First time it was overwhelming for me, but second time it was fun and I could understand it 100%. I need to implement this in real project before I forget it, Thanks a lot.

  • @gregap8282
    @gregap8282 Před rokem

    This might be the best python tutorial I've ever found online. Thanks for sharing.

  • @kostas6915
    @kostas6915 Před rokem +1

    Excellent material and excellent educational exposition! Very well done!

  • @davidsonfong9549
    @davidsonfong9549 Před rokem

    love your channel. Thank you for simplifying such valuable knowledge! Your delivery is on point.

  • @Kazner0h
    @Kazner0h Před rokem

    You are such a skilled teacher! Thank you

  • @patricioa5535
    @patricioa5535 Před rokem +2

    This was a really good tutorial showing more uses for comprehensions. Thanks!
    Also, the addition of the slides showing the important notes was a really good add. That was very welcome.
    Thanks again!

    • @PythonSimplified
      @PythonSimplified Před rokem

      Thank you so much for the incredible feedback, Patricio! Super happy you enjoyed this tutorial! 😃😃😃

  • @kris_programmer
    @kris_programmer Před rokem +2

    Love the examples. Awesome content!

  • @victorj.alonzo
    @victorj.alonzo Před rokem +2

    "Let's say that Spiderman is not exactly welcome in this DC dictionary" haha that was funny. I loved the examples.

    • @PythonSimplified
      @PythonSimplified Před rokem

      hahahaha glad you like my humor Victor! thank you! 😃

  • @chessketeer
    @chessketeer Před 9 měsíci

    Great teaching! Thank you!

  • @markslima1557
    @markslima1557 Před rokem

    I needed this video! Thank you stay awesome!

  • @milo_andrs
    @milo_andrs Před 3 měsíci

    Love the examples, thank you

  • @MrDie97crew
    @MrDie97crew Před rokem +2

    Great video, it is too clear.
    A little variation of your code for the exercise #3:
    users = ["mariyasha888", "KnotABot", "SpongiBOBO", "IAMBATMAN"]
    keys = {
    "id": lambda id: id,
    "username": lambda username: users[username],
    "password": lambda passw: "".join(random.choices(string.printable, k=8))
    }
    data = [{key:(val(i)) for (key,val) in keys.items()} for i in range(len(users))]
    Maybe it's not the best way to do it, but it's just for practice 🙃. I'm learning python 😅. and your videos are very useful!!!

  • @Sol_Naif
    @Sol_Naif Před rokem

    A million thanks Maria, your explanation is very good

  • @Owen7768
    @Owen7768 Před 9 měsíci

    your explanation is very clear, thank you!

  • @OneMilian
    @OneMilian Před rokem +1

    Thank you so much!!!!

  • @kentzhou9022
    @kentzhou9022 Před rokem

    Amazing! was looking forward to this video!! thank you thank you!!

  • @plurisdesign3210
    @plurisdesign3210 Před rokem

    Best tutorial ever

  • @dogustabiyat
    @dogustabiyat Před rokem

    Very Useful Thanks!

  • @dagmite
    @dagmite Před rokem

    Just helped me tackle my dictionary mental block.. Good stuff!

  • @Asoville18
    @Asoville18 Před rokem

    This is great. Thanks.

  • @josueporrasguajard7736
    @josueporrasguajard7736 Před 3 měsíci

    Excellent work! The clarity and didactics with which you have explained each concept are impressive. You have managed to break down complex topics into simple and accessible explanations, which is essential for deep understanding. Your ability to maintain simplicity without losing the essence of the concepts is truly admirable. Keep it up! Congratulations..

  • @sumitdutta7043
    @sumitdutta7043 Před rokem

    Thanks 😊

  • @davidpimental6704
    @davidpimental6704 Před rokem

    Mariya, you can turn the password generator into a function call. And I also added a UID function as well. Great tutorial though. Thanks so much!

  • @rahulkmail
    @rahulkmail Před rokem

    Excellent.

  • @brianpfaff5994
    @brianpfaff5994 Před 9 měsíci +1

    Very well explained! I like your videos. They help me better understand the Python language. Keep up the good work. 👍🙏

  • @oguzturkyilmaz543
    @oguzturkyilmaz543 Před rokem +1

    Thanks

  • @Anarky35
    @Anarky35 Před rokem

    Awesome video, I've learnt a lot!! Thank you so much

  • @danadasachan7208
    @danadasachan7208 Před rokem

    Thank you Mariya. I found this very helpful and easy to understand.

  • @timthompson468
    @timthompson468 Před rokem +1

    Thanks. Great video! I haven’t used dictionaries much yet, but I’ll come back to this when I do.

  • @StamosTee
    @StamosTee Před rokem +1

    This was an awesome tutorial 👍👍👍

  • @rgAlex8386
    @rgAlex8386 Před 6 měsíci

    The most complete tutorial on DC. Can you please sware more on that

  • @tomknud
    @tomknud Před rokem

    Indeed your best! ♥

  • @mrpeace422
    @mrpeace422 Před 10 měsíci

    Thanks a lot ! ❤❤. I was learned something from you. You are also better than my python profesor . U r taught something to me recent days . U r way speech and teaching is amazing itz easy to understand (but some topics are tough ) although u r videos are great 🥰

  • @suvimpemel5583
    @suvimpemel5583 Před rokem +2

    As always the examples you choose are always related to my use cases.
    Thanks a lot for the supper intuitive video.

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      That's awesome!!! Super happy I could telepathically guess the most useful examples! 😁😁😁

  • @user-wd1os3vx9q
    @user-wd1os3vx9q Před rokem +1

    Great tutorial I like very much. Thank you Mariya

  • @Thebytedoc69
    @Thebytedoc69 Před 3 měsíci

    Mariya, Thank You for your very informative and energetic videos. Your videos are excellent and flow so well. Keep up the great work.

  • @todayinhistory965
    @todayinhistory965 Před rokem +1

    Wow, thanks dear

  • @jeuxmathinfo9578
    @jeuxmathinfo9578 Před rokem

    Very useful ! 🏆🏆🏆🏅🏅🏅Thank you very much !!! 🙏🤗

  • @frenamakenson9844
    @frenamakenson9844 Před 6 měsíci

    amazing tips, thx for sharing !

  • @isojama1
    @isojama1 Před rokem +1

    Thank you for this really good video. Definetly the last example was "WOW. I wouldnt be able to do it". Nice !!!!

    • @PythonSimplified
      @PythonSimplified Před rokem

      Yeyyy!!! Super happy you liked it Danail! 😃😃😃

  • @jongcheulkim7284
    @jongcheulkim7284 Před rokem

    Thank you^^ This is very helpful.

  • @_mrmark
    @_mrmark Před rokem

    Maria, thanks for the lessons. Almost everything is clear and without translation. zip is faster

  • @manoharsagunthalla9215
    @manoharsagunthalla9215 Před 2 měsíci

    Tank you very much for the video . YOur explanations are awesome

  • @manoharsagunthalla9215
    @manoharsagunthalla9215 Před 2 měsíci

    It’s really awesome thank you for the video

  • @goldie2799
    @goldie2799 Před rokem +1

    Realy good video thanks a lot !

  • @GOTHICforLIFE1
    @GOTHICforLIFE1 Před rokem +8

    I feel like dictionary comprehensions lose a little bit of its readability compared to a conventional loop once you start applying multiple conditions. Especially with group else statements rather than the traditional elif which (as you mentioned) doesn't exists within the comprehension.
    But really nice to know about the feature as it never occurred to me that this existed.

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      I absolutely agree! I find that Comprehensions are much more comprehendible with lists hahahaha when it comes to dictionaries - the syntax becomes un-Pythonic very fast 😅
      With that said, I use it way more often than traditional loops. I think I trained my brain to actually find it intuitive 🙃 hahahaha

    • @Sinke_100
      @Sinke_100 Před rokem

      @@PythonSimplified even if it looks less redable, i so much enjoy using a comprehenssion of everything, agree with you [x:=str(i)+str(i)[-1] for i in range(0,20,10)][1]+'%' 🙂

  • @adrianrayon2834
    @adrianrayon2834 Před rokem +1

    lists/dicts comprehension are constantly on that line where they are either great and easy to make and read or just long and ugly and make it harder to read so sometimes they are great, but sometimes it´s just better to do normal for loops

  • @kieutrungtran1549
    @kieutrungtran1549 Před rokem

    You are a great teacher. Smart and beautiful

  • @jeffersonbrunheira6160
    @jeffersonbrunheira6160 Před rokem +1

    Thanks a lot! This content is very important for advanced python learn. 😃

    • @PythonSimplified
      @PythonSimplified Před rokem

      Thank you so much Jefferson! I'm glad you found it useful! 😊

  • @devvsakib5223
    @devvsakib5223 Před rokem +1

    Great!

  • @sbel177
    @sbel177 Před rokem +5

    I just discovered your channel and I've enjoyed following along with you. You are a great teacher! Thank you for all your hard work :)

  • @francismannion7075
    @francismannion7075 Před měsícem +1

    Wow that was great ,thank you..

  • @nayanjadhav7841
    @nayanjadhav7841 Před rokem

    Wonderful video.

  • @bejinbejin2744
    @bejinbejin2744 Před rokem +1

    your all videos are very very useful 👍

  • @wu1484741111
    @wu1484741111 Před 2 měsíci

    This real makes fun with dictionary comprehension for doing own private project

  • @hasanbaaqeil42
    @hasanbaaqeil42 Před rokem

    beautiful... thanks.. .. I like your extra efforts to make these videos enjoyable with nice editing and awsome graphics

  • @baylonyap1113
    @baylonyap1113 Před 11 měsíci

    Super Enjoyed and Laughing !! 😀😀😀

  • @diwakar_tsn
    @diwakar_tsn Před rokem +3

    Hey Mariya
    This video will help many💙🙃❤️

  • @Zub1Wun
    @Zub1Wun Před 14 dny

    Thank you for this video Mariya, it's really helped me in my journey

  • @caiopjv
    @caiopjv Před rokem

    Uau! Amazing!

  • @hugocesarescajeda5728

    Cheers from México 💋

  • @martella13
    @martella13 Před rokem

    I'm a Mariya simp :) :) lol your videos are an excellent supplement to my college courses! Thank you for all your hard work!

  • @taylormccoy7492
    @taylormccoy7492 Před rokem

    I think it would probably be faster to use the zip method. Two primary reasons, one being that with the range approach you have to check the list on each iteration, and two being since the zip function was probably programmed to do this efficiently it has a different method of accessing the objects. Just my guess!

  • @khalidmohamed6373
    @khalidmohamed6373 Před rokem

    well explained

  • @takeshih.1349
    @takeshih.1349 Před rokem +2

    My intuition tells me that range approach is faster, because zip approach must contain the procedure to compare between names and profs. Im a newbie for Python programming. Thank you for your videos, that help me a lot to learn Python.

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      Thank you so much for your comment Takeshi! 😃
      I'm planning a live stream in which we will compare the two approaches! my intuition also tells me range() - however, with Python 3, the zip() approach is also very efficient so I'm expecting a very close battle 😉

  • @ninabusycat
    @ninabusycat Před rokem

    Super👍🏻💕

  • @TechieGuy82
    @TechieGuy82 Před rokem +1

    Lovely as always Mariya.
    I would like to point out that using the random module isn't safe for generating passwords. People might use it to generate passwords for their various accounts online. You could mention the secrets module which is advised and secure. Anyway keep up the good work. Love you ❤️

    • @PythonSimplified
      @PythonSimplified Před rokem +2

      Thank you so much for the awesome tip, TechieGuy! 😃
      Secrets is indeed much more randomized than Random! the only issue is - I couldn't find a secrets.choices() method but rather secrets.choice() which returns a single value instead of k of them.
      From my perspective, the last exercise seemed convoluted enough to avoid the additional list comprehension of:
      password = "".join([secrets.choice(string.printable) for i in range(8)])
      That's why I went for Random instead... however - if this was a dedicated video for random passwords I'd definitely use Secrets instead 😉

  • @greisboy425
    @greisboy425 Před rokem

    If it's just a simple code, go and use list/dict comprehension, but when you logic become more complex, you better write it the old way, it's lot easier to read. Just like lambda for simple function and not for complex function.

  • @davidkitano5134
    @davidkitano5134 Před rokem +1

    great video!! thank you. You're a super teacher about python, it's easy with you!! . 3:15 I Think zip is faster than len

    • @PythonSimplified
      @PythonSimplified Před rokem

      Thank you so much for your comment David! We will compare zip() and range() in an upcoming live stream, we'll see exactly which of them beats the other 😉

  • @optimus888amicus
    @optimus888amicus Před rokem

    Hi, Sunshine ! 🌞😉👌
    Very good !

  • @flioink
    @flioink Před rokem

    I'd expect the "zip" method to be the faster one because it was purpose-made for such cases
    and probably has some built-in optimizations, no?
    Also the list comprehension where we add "man" works without putting (key, val) in brackets.

  • @cdxc_55uh
    @cdxc_55uh Před rokem

    Wow, what a nice CZcams channel. Nice to see you, Mariya!

  • @Knowledgeseeker7101
    @Knowledgeseeker7101 Před rokem

    please more video ...❤❤❤❤❤

  • @jamvin5647
    @jamvin5647 Před rokem

    3:15 I think the zip approach is faster because the syntax is more comprehensive

  • @papinpython6103
    @papinpython6103 Před rokem +1

    Trop forte cette merveilleuse dame

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 Před rokem

    very good very clever, very helpful.....but i rarely use these comprehensions and it would be faster for me to do it the long way than sit down to memorise the rules...then forget them.

  • @codewithbheem
    @codewithbheem Před rokem

    Happy teacher day mam

  • @rst2205
    @rst2205 Před rokem +7

    Requesting for a data structures and algorithm playlist

    • @PythonSimplified
      @PythonSimplified Před rokem +2

      Will do! I'm waiting to finish my current Algorithms and DS 2 module in university before I can properly cover the topic 😉
      (My final exam is in September, so not much longer to wait 😊)

    • @rst2205
      @rst2205 Před rokem

      @@PythonSimplified All the best for your exams mam!!

    • @realmadwolf
      @realmadwolf Před rokem

      @@PythonSimplified Great, And all the best for your exams tho you gonna score 10/10 anyways

  • @varunkaniyala6302
    @varunkaniyala6302 Před rokem

    I became mad after watching this video. But you are a great tutor. I became a fan of you. Love you and your English. Thank you so much🧐😵‍💫🤒. I request you to please start a complete python tutorial for beginners.

  • @manoharsagunthalla9215
    @manoharsagunthalla9215 Před 2 měsíci

    Will you please explain in separate video about how to read multiple elements from user at time using split function . 2. How to sort a dictionary without converting to tulle

  • @kaisj7
    @kaisj7 Před rokem +1

    Nice Video THX , I just begin study dictionary

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      Awesome timing then! 😉
      Best of luck with studying, Kais! 😃

    • @kaisj7
      @kaisj7 Před rokem

      @@PythonSimplified I try my best I very like Python and I love to learn it and U help me really 😄

  • @ivankuz1316
    @ivankuz1316 Před rokem

    Cool

  • @georgeorwell2334
    @georgeorwell2334 Před rokem +1

    NIce to see again - greets from Germany.

    • @PythonSimplified
      @PythonSimplified Před rokem

      Thank you so much George Orwell! Huge fan of your 1984 book 😉 hahaha
      Greetings from Vancouver! 😃

  • @jackroark6928
    @jackroark6928 Před rokem

    🍓⭐high quality

  • @darta1094
    @darta1094 Před rokem +1

    Password generation code (in my tests) may produce a string with one or more spaces. Used replace to get rid of those.

    • @PythonSimplified
      @PythonSimplified Před rokem

      That was my original plan, Dimitri! 😃but then I thought to myself - what's the problem with spaces? I couldn't find a single reason why they would be any different from the rest of the characters 🤷‍♀️
      Some sites do prevent you from using spaces within passwords - but I don't think it's based on merit. Do you find that space-less passwords are more secure?

    • @Sinke_100
      @Sinke_100 Před rokem

      Because string.printable contains whitespace \t,
      ,
      , at first i used to cut it at the end when i imported it, but for me better aproach was change the original string module and create printable_ww same but without white space, i would like to contribute to open source to change that for python 3.12 if comunity accepts it

  • @guenzizabdelaziz5185
    @guenzizabdelaziz5185 Před rokem

    Hi Mariya
    I like your CZcams channel for Python

  • @Yachid
    @Yachid Před rokem +2

    Hey Mariya~!

  • @shinrafahell
    @shinrafahell Před rokem +1

    Thank you beautiful smart lady!

  • @kom_senapati
    @kom_senapati Před rokem

    Another solution to the list of dicts problems:
    import random as r
    from string import printable as p
    from pprint import pprint
    users = ["Hanzo","Peter","Brian"]
    keys = ["id","user","password"]
    pprint([dict(
    id = i,
    user = user,
    password = "".join(r.choices(p,k=9))
    ) for i,user in enumerate(users)])

  • @androidfreak88
    @androidfreak88 Před rokem

    😍

  • @igbuku-otukofinyro4372

    Hello this tutorial is excellent, do you have a python beginner course?

  • @guimoncao
    @guimoncao Před rokem +1

    I'm not a Python programmer, but I like your videos

    • @PythonSimplified
      @PythonSimplified Před rokem +1

      Thank you so much Guilherme!! 😃 I might end up convincing you to start using Python... I have some really exciting projects in the making 😉

    • @guimoncao
      @guimoncao Před rokem

      @@PythonSimplified Maybe I can use it in my projects too

  • @semlion4972
    @semlion4972 Před rokem +1

    Thanks for another video if you can in the future make python with MySQL some mini project tnx. 😀

    • @PythonSimplified
      @PythonSimplified Před rokem

      Hi Sem 😃
      MySQL is definitely on my to-do list! will cover it in my Linux machine in future tutorials. In the meanwhile, you can checkout my SQLite tutorials:
      ⭐ SQLite Backend for Beginners:
      czcams.com/video/Ohj-CqALrwk/video.html
      (please note - the above tutorial is missing connection.commit())
      ⭐Web Scraping Databases with Mechanical Soup and Sqlite:
      czcams.com/video/MkGQmZoMuRM/video.html
      (includes connection.commit() which is very important!)
      It's not exactly MySQL, but it's right off the same alley 😉

  • @aasifkhan1545
    @aasifkhan1545 Před rokem +1

    I think the range approach is fastest.