How to use list comprehension in Python | 2MinutesPy

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • #list #listcomprehension #python #pythonprogramming #2minutespy
    🖐Hey, want to know about list comprehension in Python?
    🐍 In this video, we're diving into the world of list comprehension - a super handy technique in Python that allows you to create lists more concisely and elegantly.
    I'll walk you through the basics, breaking down how list comprehension works and why it's so useful with examples.
    More 2 Minutes Python Tutorial:
    How to use map() in Python: • How to use map() funct...
    reverse() vs. reversed() in Python: • Python's reverse() Vs ...
    Why Flask(__name__) is Used When Creating a Flask App? • Why Flask(__name__) is...
    What is Global Interpreter Lock in Python? • Global Interpreter Loc...
    What is a Lambda Function in Python? • What is a Lambda Funct...
    Why __init__.py File is Used in Python Projects: • Why __init__.py File i...
    if _name_ == "__main__" in Python: • What if __name__ == '_...
    Python's seek() and tell() functions in 2 Minutes: • Understanding Python's...
    Python Threading in 2 Minutes: • Python Threading in 2 ...
    Python's super() function in 2 Minutes: • Python's super() Funct...
    How to Use *args and **kwargs in 2 Minutes: • How to Use *args and *...
    Python's ABC (Abstract Base Class) in 2 Minutes: • Python's ABC (Abstract...
    Python's _init_ Method in 2 Minutes: • Python's __init__ Meth...
    Python's _getitem_ Method in 2 Minutes: • Python's __getitem__ M...
    Subscribe to / @2minutespy for more such videos.
    @2MinutesPy

ความคิดเห็น • 23

  • @pranaylohar9389
    @pranaylohar9389 หลายเดือนก่อน +1

    Can't imagine someone can explain this in 2 minutes hats off to you man

    • @2MinutesPy
      @2MinutesPy  หลายเดือนก่อน

      Thanks

  • @RazzelMedia
    @RazzelMedia 5 หลายเดือนก่อน +5

    F*ck MAN. I'm just a begginer, started learning python a few days ago, and no one was able to explain it so clearly. THANK YOU SOOOOOOOO MUCH. Hope your channel will grow into one of the biggest in the space, because it deserves. 🔥🔥🔥🔥

    • @2MinutesPy
      @2MinutesPy  5 หลายเดือนก่อน

      Great to hear!

  • @TakeElite
    @TakeElite 7 หลายเดือนก่อน +4

    it crazy how you made me understand this concept so easily! THANK YOU!!

    • @2MinutesPy
      @2MinutesPy  7 หลายเดือนก่อน

      Glad it helped!

  • @rexsybimatrimawahyu3292
    @rexsybimatrimawahyu3292 7 หลายเดือนก่อน

    I ve been using list comprehension ever since in scraping project, its been a blast

  • @perrosaurio725
    @perrosaurio725 6 หลายเดือนก่อน +1

    Thanks, this was the best way to understand list comprehension.
    Loving python.

    • @2MinutesPy
      @2MinutesPy  6 หลายเดือนก่อน

      Great to hear!

  • @Rahul5556e
    @Rahul5556e 7 หลายเดือนก่อน

    List comprehension and for loop, both are good and must be used periodically

  • @Upresi
    @Upresi 8 หลายเดือนก่อน +3

    Great video :D

    • @2MinutesPy
      @2MinutesPy  8 หลายเดือนก่อน

      Thanks! 😁

  • @mkarvj
    @mkarvj 8 หลายเดือนก่อน +1

    Very nice sir....

    • @2MinutesPy
      @2MinutesPy  8 หลายเดือนก่อน

      Thanks and welcome

  • @maxpythoneer
    @maxpythoneer 7 หลายเดือนก่อน

    Yeah I use it too when working with lists

    • @2MinutesPy
      @2MinutesPy  7 หลายเดือนก่อน

      Cool

  • @Gclips2525
    @Gclips2525 6 หลายเดือนก่อน

    Can u take input using list comprehension

    • @2MinutesPy
      @2MinutesPy  6 หลายเดือนก่อน

      Yes, absolutely.
      for example:
      user = [int(input("Enter a value: ")) ** 2]
      for val in user:
      print(val)

  • @arielmolina6277
    @arielmolina6277 8 หลายเดือนก่อน

    👏🏻👏🏻👏🏻👏🏻

  • @jell._.y
    @jell._.y 6 หลายเดือนก่อน +1

    damn that's crazy

    • @2MinutesPy
      @2MinutesPy  6 หลายเดือนก่อน +1

      Thanks man

  • @doodley-wb6uu
    @doodley-wb6uu หลายเดือนก่อน

    G

  • @BudgiePanic
    @BudgiePanic 7 หลายเดือนก่อน

    These AI channels are getting out of hand
    ChatGPT script, AI voice actor