“Tuple en Python” Código de respuesta

Tuple Python

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

Tuplein Python

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

Coder Cat

Tuple en Python

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

Ejemplo de tuple de 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 en 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

Respuestas similares a “Tuple en Python”

Preguntas similares a “Tuple en Python”

Más respuestas relacionadas con “Tuple en Python” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código