tuple python
tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
moi_crn
tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
a=(1,2,3,4)
print(a[-3])
name_of_students = ("Jim" , "yeasin" , "Arafat")
print(name_of_students.index('Arafat'))
# Creating a Tuple with
# the use of Strings
Tuple = ('Geeks', 'For')
print("\nTuple with the use of String: ")
print(Tuple)
# Creating a Tuple with
# the use of list
list1 = [1, 2, 4, 5, 6]
print("\nTuple using List: ")
Tuple = tuple(list1)
# Accessing element using indexing
print("First element of tuple")
print(Tuple[0])
# Accessing element from last
# negative indexing
print("\nLast element of tuple")
print(Tuple[-1])
print("\nThird last element of tuple")
print(Tuple[-3])
tupel python
#Tuple is immutable(which can't change)
fruits = ("Apple", "orange", "pears")
# You can check place, character in it but can't change