Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Differentiate Between append() and extend().

Satinder Rawal answered on April 24, 2023 Popularity 2/10 Helpfulness 1/10

Contents


More Related Answers

  • what difference between extend and append in list python
  • extend vs implement in java
  • List Method: list append vs extend
  • append vs extend
  • append vs extend
  • _.extend Example
  • Example Of _.extend
  • Example Of _.extend
  • Example of _.extend
  • _.extend() Explanation
  • Another _extend Example
  • Another _.extend Example
  • extend append
  • python extend vs append

  • Differentiate Between append() and extend().

    0

    append()

    extend()

    append() adds an element to the end of the list

    Example -

    >>lst=[1,2,3]

    >>lst.append(4)

    >>lst

    Output:[1,2,3,4]

    extend() adds elements from an iterable to the end of the list

    Example -

    >>lst=[1,2,3]

    >>lst.extend([4,5,6])

    >>lst

    Output:[1,2,3,4,5,6] 

    Popularity 2/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Apr 24 2023
    Satinder Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.