What is the function of commit() and execute() and append() and extend()
Answers
Answered by
1
Explanation:
Introduction
Python 3 has a number of built-in data structures, including lists. Data structures provide us with a way to organize and store data, and we can use built-in methods to retrieve or manipulate that data.
To get the most out of this tutorial, you should have some familiarity with the list data type, its syntax, and how it is indexed. You can review lists by reading the tutorial Understanding Lists in Python 3.
Here, we’ll go through the built-in methods that you can use to work with lists. We’ll add items to and remove items from lists, extend lists, reverse and sort lists, and more.
It is important to keep in mind that lists are mutable — or changeable — data types. Unlike strings, which are immutable, whenever you use a method on a list you will be affecting the list itself and not a copy of the list.
For this tutorial, we’ll be working primarily with a list comprised of an inventory of various fish that we need to modify as fish are added to or removed from a municipal aquarium.
list.append()
The method list.append(x) will add an item (x) to the end of a list. We’ll start with a list of our fish that are dispersed throughout the aquarium.
HOPE IT HELPS!!!!
Similar questions
Social Sciences,
4 months ago
English,
4 months ago
Accountancy,
4 months ago
Chemistry,
9 months ago
Computer Science,
1 year ago
Chemistry,
1 year ago