-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.py
More file actions
121 lines (48 loc) · 980 Bytes
/
Copy pathList.py
File metadata and controls
121 lines (48 loc) · 980 Bytes
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env python
# coding: utf-8
# In[1]:
my_list = [1,2,3]
my_list
# In[2]:
my_list[1:]
# In[3]:
my_list[:2]
# In[4]:
# here is same as string that [1:3] means index 1 till <3 index
my_list[1:3]
# In[5]:
second_list = [4,5,6]
# In[6]:
# concatination of list
new_list = my_list+second_list
new_list
# In[7]:
new_list[0] = "uzair"
# In[8]:
# in list we can add any data type
new_list
# In[9]:
# by appending we can add new value in list
new_list.append(9)
# In[10]:
new_list
# In[11]:
# by pop we can get last value and delete that value from list of index
new_list.pop()
# In[20]:
str1 = [4,5,1,2,3,6,6,8]
str2 = ['b','c','a','g','e','i','l','f']
# In[21]:
# this is sorting function of string but for sorting we have to put all values in one datatype
str1.sort()
str1
# In[22]:
str2.sort()
# In[23]:
str2
# In[24]:
# this is a reverse function of list
str1.reverse()
# In[25]:
str1
# In[ ]: