Skip to content

Commit b386e82

Browse files
committed
added tuples in python
1 parent ce87fca commit b386e82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tuples/tuples.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tuples :- Its a collection which is ordered, unchangeable and duplicates are allowed
22

3-
bio = ("Aakarsh", 21, "male")
3+
bio = ("Aakarsh", 21, "male") #A tuple is created
44
print(bio)
55

66
# Operations that can be performed on tuples is limited to 'index' and 'count' since
@@ -9,3 +9,6 @@
99
print(bio.count(21)) #Displays the count of argument in tuple 'bio'
1010
print(bio.index("male")) #Displays the index of passed argument
1111

12+
#looping through tuple
13+
for x in bio:
14+
print(x,end=' ')

0 commit comments

Comments
 (0)