forked from mAhmedSiddiki/Python_Full_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10_tuple.py
More file actions
76 lines (41 loc) · 913 Bytes
/
10_tuple.py
File metadata and controls
76 lines (41 loc) · 913 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
# =============================================================================
# tuple()
# =============================================================================
a = ("Doreamon","sdjfhan","Tom and Jerry")
b = (1,2,3,4,5,3,3)
print(b.count(3))
print(sorted(a,reverse=True))
print(a.index("Tom and Jerry"))
print(sum(b))
print(min(b))
print(len(a))
print(b+a)
print(a*2)
if "Shinchan" in a:
print("found")
else:
print("not found")
for i in a:
print(i)
a = ()
print(a)
b = list(a)
b.append("sjdhf")
print(a,b,sep="\n")
a = tuple(b)
print(a)
print(a)
print(a[-3:-1])
b = ("Doreamon",["Shinchan",2,3,4],("codinglaugh","marjuk"),1,4,7,2)
print(len(b[1]))
for i in b:
if type(i) is list:
for j in i:
print(j)
elif type(i) is tuple:
for j in i:
print(j)
else:
print(i)
b[1][0] = "djhbf"
print(b)