Skip to content

Instantly share code, notes, and snippets.

@waseeld
Last active May 22, 2020 18:31
Show Gist options
  • Save waseeld/9b7e2c226584275cd1439b8d99ce5b8a to your computer and use it in GitHub Desktop.
Save waseeld/9b7e2c226584275cd1439b8d99ce5b8a to your computer and use it in GitHub Desktop.

القوائم في البايثون

my_list = [3, 5, 9]
print(my_list)
[3, 5, 9]

Edite

my_list[0] = 2

Selection

my_list[0]
2
my_list[0:3]
[2, 5, 9]

Indexing

my_list.index(9)
2

Add

insert(index, value)

my_list.insert(0, 15)
my_list
[15, 2, 5, 9]

append(value)

my_list.append(15)

Removing

clear()

my_list.clear()

remove(value)

my_list.remove(15)
my_list
[2, 5, 9, 15]

pop(index)

my_list.pop()
15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment