Professional Documents
Culture Documents
Day 1
Day 1
# Use negative index to get the value of the second last element
tuple1[-2]
# Use negative index to get the value of the third last element
tuple1[-3]
# A sample tuple
Ratings = (0, 9, 6, 5, 10, 8, 9, 6, 2)
print(Ratings)
# sample tuple
genres_tuple = ("pop", "rock", "soul", "hard rock", "soft rock", \
"R&B", "progressive rock", "disco")
len(genres_tuple)
# Write your code below and press Shift+Enter to Find the length of the tuple,
genres_tuple:
len(genres_tuple)