Source Code:
(back to article)
# list example fruits = ['apple', 'banana', 'orange'] fruits.append('mango') print(fruits) # Output: ['apple', 'banana', 'orange', 'mango'] # tuple example fruits = ('apple', 'banana', 'orange') # fruits.append('mango') # this will give an error print(fruits) # Output: ('apple', 'banana', 'orange')
Result:
Report an issue