Answers for "add the value 10 to the end of data in python"

3

how to insert item last in list python

list = [item, item1, item2...]
list.insert(len(list), other_item)
#For results just print the list, it should work...
#Also courtesy of Stack Overflow
Posted by: Guest on April-08-2020
1

python append n numbers to list

# Basic syntax:
your_list.extend([element]*number)
# Where:
#	- element is the element you want to add to your_list
#	- number is the number of times you want it repeated

# Note, .extend modifies your_list in place

# Example usage:
your_list = [1, 2, 3]
your_list.extend([0]*5)
print(your_list)
--> [1, 2, 3, 0, 0, 0, 0, 0]
Posted by: Guest on November-11-2020

Code answers related to "add the value 10 to the end of data in python"

Python Answers by Framework

Browse Popular Code Answers by Language