Skip to content

Instantly share code, notes, and snippets.

@Sachin-crypto
Created March 23, 2023 17:00
Show Gist options
  • Save Sachin-crypto/338be6a7bea2e70395634d8da8dc1fd5 to your computer and use it in GitHub Desktop.
Save Sachin-crypto/338be6a7bea2e70395634d8da8dc1fd5 to your computer and use it in GitHub Desktop.
A simple demonstration of list extend()
# List of names
friends = ['Sachin', 'Rishu', 'Yashwant']
# Printing the original list
print('Original List:', friends)
# Using extend() to extend the list
friends.extend(['Yogesh', 'Abhishek'])
# Printing the updated list
print('New List: ', friends)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment