“Tuple in Python” Kod odpowiedzi

Tuple Python

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

Tuplein Python

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

Coder Cat

Tuple in Python

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

Przykład 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 in 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

Odpowiedzi podobne do “Tuple in Python”

Pytania podobne do “Tuple in Python”

Więcej pokrewnych odpowiedzi na “Tuple in Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu