Skip to content

Commit 958baec

Browse files
authored
Update tuples.py
1 parent f525ee0 commit 958baec

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tuples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
t1 = ()
55
print (t1)
66

7-
t2 = [1,2,3,4,5] # tuple with number datatype
8-
t3 = ["codex" , "iter" , "python"] # tuple with string datatype
9-
t4 = ["codex" , 25 , 50.25 , "iter"] # tuple with different datatype
7+
t2 = (1,2,3,4,5) # tuple with number datatype
8+
t3 = ("codex" , "iter" , "python") # tuple with string datatype
9+
t4 = ("codex" , 25 , 50.25 , "iter") # tuple with different datatype
1010

1111
print (t2)
1212
print (t3)
1313
print (t4)
1414

1515

16-
tupple = [10 , 20 , 30 , 40 , 50]
16+
tupple = (10 , 20 , 30 , 40 , 50)
1717
# printing tuples
1818
print (tupple) #prints the whole tuples
1919
print (tupple[2]) #prints the 2nd index ,i.e, the 3rd element of the tuples
@@ -24,4 +24,4 @@
2424

2525
# IMPORTANT:
2626
# Changing values in tuple is not allowed
27-
# Deleting a single element is not allowed. you have to delete the whole tuple
27+
# Deleting a single element is not allowed. you have to delete the whole tuple

0 commit comments

Comments
 (0)