“Python -Tupeloperationen” Code-Antworten

Python -Tupeloperationen

# Membership test in tuple
my_tuple = ('a', 'p', 'p', 'l', 'e',)

# In operation
print('a' in my_tuple)
print('b' in my_tuple)

# Not in operation
print('g' not in my_tuple)
SAMER SAEID

Python -Tupelmethoden

count(x) : Returns the number of times 'x' occurs in a tuple
index(x) : Searches the tuple for 'x' and returns the position of where it was first found
MayMau

Tupel 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

Ähnliche Antworten wie “Python -Tupeloperationen”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen