-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtuple.py
More file actions
53 lines (31 loc) · 831 Bytes
/
tuple.py
File metadata and controls
53 lines (31 loc) · 831 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
# fruit = ("Mango", "Apple", "Banana", "Grape", "Blackberry")
# x = list(fruit)
# x[0] = "Canbo"
# y = tuple(x)
# print(y)
# for x in fruit:
# print(x)
# fruit = ("Mango", "Apple", "Banana", "Grape", "Blackberry")
# for index, x in enumerate(fruit):
# print(index, x)
# fruit = ("Mango", "Apple", "Banana", "Grape", "Blackberry")
# if "Apple" in fruit:
# print("Yes")
# else:
# print("No")
# HUBI INAAD COMMA KU DARTO
# one_fruit = ('Apple',)
# print(type(one_fruit))
# How to delete
# fruit = ("Mango", "Apple", "Banana", "Grape", "Blackberry")
# del fruit
# print(fruit)
# How to add 2 tuples
# num1 = (1, 3, 4)
# num2 = (5, 3, 7)
# nums = num1 + num2
# print(nums)
# Unpacking sida loo sameeyo
# student = ("Duraan", "Math", 30)
# (name, subject, age) = student
# print(name, subject, age)