Skip to content

Commit d4ec491

Browse files
author
Algorithmica
authored
Add files via upload
1 parent 452755c commit d4ec491

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
a = 10
2+
print(type(a))
3+
print(a)
4+
5+
b = 20.6
6+
print(type(b))
7+
print(b)
8+
9+
c = True
10+
print(type(c))
11+
print(c)
12+
13+
d = "abc"
14+
print(type(d))
15+
print(d)

2019-october/1.python/2.list.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
list1 = [10, 20, 'abc', True, 30.6]
2+
print(type(list1))
3+
print(list1)
4+
print(id(list1))
5+
6+
list2 = ['xyz', 'a', "abc", 12]
7+
print(list2)
8+
print(id(list2))
9+
10+
list3 = list2
11+
print(list3)
12+
print(id(list3))
13+
14+
list4 = list2.copy()
15+
print(list4)
16+
print(id(list4))
17+
18+
print(list1 == list2)
19+
print(list2 == list3)
20+
21+
list5 = [10, list1, 'abc', True, list4]
22+
print(list5)
23+
print(type(list5))
24+
25+
#element access
26+
list1[2]
27+
list1[1:4]
28+
list1[1:4:2]
29+
list1[2:]
30+
list1[:3]
31+
32+
#manipulate list
33+
list1.append(50)
34+
list1.pop()

0 commit comments

Comments
 (0)