“Tuple dalam Python” Kode Jawaban

Tuple Python

tuple = ("Facebook", "Instagram", "TikTok", "Twitter")
moi_crn

Tuplein Python

a=(1,2,3,4)
print(a[-3])

Coder Cat

Tuple dalam Python

name_of_students = ("Jim" , "yeasin" , "Arafat")
print(name_of_students.index('Arafat'))
YEASIN ARAFAT

Contoh Tuple Python

# 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])
No Name

Tuple Python

tupel python
Ma

Tuple dalam Python

#Tuple is immutable(which can't change)
fruits = ("Apple", "orange", "pears")
# You can check place, character in it but can't change
Ugly Unicorn

Jawaban yang mirip dengan “Tuple dalam Python”

Pertanyaan yang mirip dengan “Tuple dalam Python”

Lebih banyak jawaban terkait untuk “Tuple dalam Python” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya