Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

add Elements to Python list Using extend() method

# Python program to demonstrate
# Addition of elements in a List
   
# Creating a List
List = [1,2,3,4]
print("Initial List: ")
print(List)
 
# Addition of multiple elements
# to the List at the end
# (using Extend Method)
List.extend([8, 'Softhunt', 'Tutorials'])
print("
List after performing Extend Operation: ")
print(List)
Comment

PREVIOUS NEXT
Code Example
Python :: List Comprehension simple example 
Python :: Math Module atan() Function in python 
Python :: matplotlib pie turn small pct labels off 
Python :: Python 2 vs Python 3 Print Statement 
Python :: numpy random sin 
Python :: ascii julius caesar python encryption 
Python :: stop level of the broker 
Python :: python 3.9 32 bit 
Python :: python get text that is already printed 
Python :: Algorithms and Data Structures in Python (INTERVIEW Q&A) 
Python :: which can be reversed , string or list? 
Python :: convert float array to integer 
Python :: godot ternary 
Python :: list expression inside bracket python 
Python :: Python NumPy rollaxis Function Example 
Python :: df create dummy from multiple category 
Python :: Set changed size during iteration 
Python :: Python NumPy block Function Example by using simple array 
Python :: python locateonscreen method 
Python :: (ax=self.canv.axes ,style="ro--") 
Python :: python interpreter after running a python file 
Python :: del mutiple indexes at once 
Python :: NumPy unpackbits Code Unpacked array along default axis 
Python :: numpy image processing 
Python :: penggunaan fromkeys di python 
Python :: django hash password Argon 
Python :: python get dataframe vlaues where cell is higher than 
Python :: operasi tipe data integer 
Python :: object get in djangi 
Python :: Python beginner question - trying to understand return statement 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =