# Simple Tuples
# Tuples are list, the elements stored in which cannot be changed.
t1 = (23, 45)
print (t1)
print (t1[1])
# Can have more than two elements
t1 = (1, 2, 3, 4, 5, 6, 7)
print (t1)
print (t1[4])
# Cannot change the elements stored as compared to lists
l1 = [1, 2, 3, 4, 5, 6, 7]
t1 = (1, 2, 3, 4, 5, 6, 7)
# Can change elements in list
l1[4] = 1
# Cannot change elements in tuple (Uncomment it to see the error)
#t1[4] = 1
print (l1)
print (t1)
# Looping over a tuple
t1 = (34, 12, 56, 78, 89)
for t in t1:
print (t)
# Writing over a tuple
# One cannot change the elements stored in the tuple.
# But you can assign a new tuple to the variable that stores the tuple you wanna change.
t1 = (23, 12, 45, 78)
print (t1)
t1 = (45, 67) # t1 changed to new value
print (t1)