List

What is a List?
List: A data structure containing elements separated by the "," sign.
The concept of list is based on the "LIFO" ---> Last In First Out.

Commands in lists

How to add a member to the list? lst.append("...") command.

How to input a list?

Each character in the list is numbered from 0 to the end of the list. A specific value in a list can be accessed by using [ ].

Remember! You can access the character in the opposite way:

A member can be cut from the original list by using colons inside [::], which allows start, end and jump (if necessary).
Remember: The last character will not be included in the cut!

How to check the length of the list? len(lst) command.

How to check how many times the member appears in a list? lst.count(β€œ...”) command.

How to check if the member is in the list? in command.

How to delete a member from the list? lst.remove("...") command.

but! What will happen if we try to delete a member that does not appear in the list???

In order to avoid this error, we will first check whether the member appears in the list by if()

How to delete a member according to its location? lst.pop(index) command.
If you don't choose a place, the last member will be deleted!

How do you know where the member is located? lst.index("...") command.

but! What will happen if we try to find a member that does not exist in the list?

In order to avoid this case, we would like to check whether the member even appears in the list using if()

How to go through a list?

There are 2 methods:
The first - by index, traversing by range and accessing the list members by their index.
The second - by value, going over the list according to the values ​in it.

This part requires knowing strings:

How to turn a list into text? "...".join(lst) command.

How to turn text into a list? string.spilt("...") command.

How to turn text into a list, so that each letter is a member? list(string) command.