-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyLists.py
More file actions
53 lines (29 loc) · 721 Bytes
/
PyLists.py
File metadata and controls
53 lines (29 loc) · 721 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
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 4 18:13:26 2018
@author: kmuthu2
"""
list1 = [1,23,4,'hi','hello',[2334,56,7678,78]]
list1[2]
list1[-1][0]
list1.index('hi')
len(list1)
tuple1 = (1,2,3,4)
list2 = [1,23,4,'hi','hello',[2334,56,7678,78],tuple1]
list1 += tuple1
check = bool(list1 == list2)
#Check value not true
list1.append(tuple1)
check1 = bool(list1 == list2)
#True
'''
Just by + tuple elements are added but only as separate elements so false comes
for check
but in check1 we used the append function of the list so it appends
'''
del list1[1]
list1.remove('hello')
list1.pop(0)
#Aliasing in python
x = ['A','B','C']
y = x