# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Tuple and its methods

tuple = (1,2,2,3,4,4,4,5,5,6,7,8)

tuple

# +
# Returns the number of times a specified value occurs in a tuple

tuple.count(4)

# +
# Searches the tuple for a specified value and returns the position of where it was found

tuple.index(8)

# +
#  Print the number of items in the tuple:

len(tuple)
# -

tuple2 = (1,2,3,4,5,6)

tuple2

# +
# To join two or more tuples

tuple3 = tuple + tuple2
# -

tuple3

# +
# You cannot remove items in a tuple.

del tuple3
# -

tuple3

# #  The End

StarcoderdataJupyterScriptsDedupFiltered