Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
37 lines (36 loc) · 814 Bytes

File metadata and controls

37 lines (36 loc) · 814 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
list1 = ["apple", "banana", "orange", "papaya", "papaya"]
print(list1)
# append()
list1.append("luly") # last mai value add karta hai
print(list1)
# extend()
# two list value ko merge karta hai
list1.extend(["mango", "pineAPPLE"])
print(list1)
# index
print(list1.index("luly"))
print(list1)
# insert
print(list1.insert(1, "mmm"))
print(list1)
# count duplicate count karta hai
list2 = [1, 2, 3, 4, 4, 55, 66, 6, 7, 8, 9, "aa", "aa", "v"]
print(list2.count("aa"))
print(list2.count(4))
# remove
print(list2.remove(9))
print(list2)
# pop index ke according delete karta hai
print(list2.pop(2))
print(list2)
# reverse
print(list2.reverse())
print(list2)
# sort
# accending order
list3 = [1, 22, 3, 4, 4, 5, 5, 6, 65, 3, 2, 9, 1, 0]
list3.sort()
print(list3)
# reverse sorting
list3.sort(reverse=True)
print(list3)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.