Unpacking Operators in Python: What are * and **?

Поділитися
Вставка
  • Опубліковано 18 січ 2025

КОМЕНТАРІ • 20

  • @gedtoon6451
    @gedtoon6451 3 місяці тому +2

    The * operator can be used to unpack an iterable into separate variables. The ** can be used to unpack a dictionary. But in the case of *args and **kwargs used as function parameters, they are packing and not unpacking. *args takes several positional arguments and packs them into a tuple. **kwargs takes several named parameters and packs them into a dictionary.

  • @PoeLemic
    @PoeLemic 8 місяців тому +1

    I love your channel, because I'm trying to make my understanding better and deeper. I just love how you go through different examples and start slow, then you move up to harder problems.

  • @cvicracer
    @cvicracer 8 місяців тому +4

    Your videos are so helpful. i learn something new every time i watch.
    Thank you very much!!!

  • @allenmark7981
    @allenmark7981 8 місяців тому +6

    Clearly explained with easy to follow examples, thank you!

  • @r.e.keerthana
    @r.e.keerthana 8 місяців тому +1

    * unpacking is something that i had no idea of thanks NN!

  • @DarthJarJar10
    @DarthJarJar10 7 місяців тому

    This was useful for me, even as someone who has made use of both unpacking operators aplenty.

  • @Pr0feBboy
    @Pr0feBboy 8 місяців тому

    Wow this is really interesting..... each day i find out something new about python ... such endless field of possibilities

  • @johnwight6041
    @johnwight6041 8 місяців тому

    Fantastic video! Thank you. I knew a little bit about unpacking operators but not enough to really use them.

  • @rons96
    @rons96 8 місяців тому +1

    Nicely explained, thx!

  • @TheEcherriman
    @TheEcherriman 8 місяців тому +1

    Thanks, I could have done something else this morning and I wouldn't have wasted it looking for ways to do this if I'd known this was coming out. Python is very powerful but it's sometimes difficult when you don't know what you're looking for or what it may be called

  • @allanribeiro7268
    @allanribeiro7268 8 місяців тому

    Great video!!! Keep going with the great work!!!

  • @MrValVet
    @MrValVet 8 місяців тому

    awesome, thank you

  • @IdPreferNot1
    @IdPreferNot1 8 місяців тому

    short and concise! :)

  • @chriskeo392
    @chriskeo392 8 місяців тому +2

    Can I get a video of when to use arga kwargs

    • @r.e.keerthana
      @r.e.keerthana 8 місяців тому +1

      When u have same operation repeated for an unknown number of times, for which normally you would put a for loop with the length of the parameter, but this is more efficient

  • @voximir
    @voximir 8 місяців тому

    I have a question, what OS are you using?

  • @zulhishamtan4308
    @zulhishamtan4308 8 місяців тому

    I love all your videos...

  • @ИванКузякин-б2н
    @ИванКузякин-б2н 8 місяців тому +1

  • @pedrolopess9601
    @pedrolopess9601 8 місяців тому

    also for tuples.