-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuple.py
More file actions
111 lines (74 loc) · 2.13 KB
/
Copy pathtuple.py
File metadata and controls
111 lines (74 loc) · 2.13 KB
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
# thistuple = ("apple", "banana", "cherry")
# print(len(thistuple))
# thistuple = ("apple",)
# print(type(thistuple))
#NOT a tuple
# thistuple = ("apple")
# print(type(thistuple))
# mytuple = ("apple", "banana", "cherry")
# print(type(mytuple))
# thistuple = ("apple", "banana", "cherry")
# print(thistuple[-3])
# thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango")
# print(thistuple[2:5])
# thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango")
# print(thistuple[:4])
# thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango")
# print(thistuple[2:])
# thistuple = ("apple", "banana", "cherry", "orange", "kiwi", "melon", "mango")
# print(thistuple[-4:-1])
# thistuple = ("apple", "banana", "cherry")
# if "apple" in thistuple:
# print("Yes, 'apple' is in the fruits tuple")
# x = ("apple", "banana", "cherry")
# y = list(x)
# y[1] = "kiwi"
# x = tuple(y)
# print(x)
# thistuple = ("apple", "banana", "cherry")
# y = list(thistuple)
# z= list(thistuple)
# y.append("orange")
# z.append("mango")
# thistuple = tuple(y)
# thistuple = tuple(z)
# print(thistuple)
# fruits = ("apple", "banana", "cherry", "strawberry", "raspberry")
# (green, yellow, *red) = fruits
# print(green)
# print(yellow)
# print(red)
# fruits = ("apple", "mango", "papaya", "pineapple", "cherry")
# (green, *tropic, red) = fruits
# print(green)
# print(tropic)
# print(red)
# thistuple = ("apple", "banana", "cherry")
# for x in thistuple:
# print(x)
# thistuple = ("apple", "banana", "cherry")
# for i in range(len(thistuple)):
# print(thistuple[i])
# thistuple = ("amma", "abba", "bahan")
# for i in range(len(thistuple)):
# print(thistuple[i])
# print(i)
# thistuple = ("apple", "banana", "cherry")
# i = 0
# while i < len(thistuple):
# print(thistuple[i])
# i = i + 1
# print(i)
# thistuple = ("Ashriti", "Maheen", "Farah")
# i = 0
# while i < len(thistuple):
# print(thistuple[i])
# i = i +1
# print(i)
# fruits = ("apple", "banana", "cherry")
# mytuple = fruits * 2
# print(mytuple)
# tuple1 = ("a", "b" , "c")
# tuple2 = (1, 2, 3)
# tuple3 = tuple1 + tuple2
# print(tuple3)