{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 4. Tuple\n", "\n", "In this section, we'll explore the concept of tuples in Python. \n", "\n", "**Tuples** are ordered, immutable sequences that can store various types of data. We'll learn how to create, access, and manipulate tuples effectively.\n", "\n", "We'll learn about the following topics:\n", "\n", " - [4.1. Creating Tuples](#Creating_Tuples)\n", " - [4.2. Built-in Tuple Functions](#Builtin_Tuple_Functions)\n", " - [4.3. Tuple Indexing and Slicing](#Tuple_Indexing_and_Slicing)\n", " - [4.4. Tuple Properties](#Tuple_Properties)\n", " - [4.5. Tuple Operators](#Tuple_Operators)\n", " - [4.6. Built-in Tuple Methods](#Builtin_Tuple_Methods)\n", " - [4.7. Nesting Tuples](#Nesting_Tuples)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n",
"
\n",
"
| Name | \n", "Type in Python | \n", "Description | \n", "Example | \n", "
|---|---|---|---|
| Tuples | \n", "tuple | \n", "Comma-separated ordered immutable sequence of objects in parentheses ( ). | \n", "(10,'hello', 15.9) | \n", "
\n",
"
\n",
"
\n",
"
\n",
"
| Method | \n", "Description | \n", "
|---|---|
| index(m,a(optional),b(optional)) | \n", "the index of first occurrence of m for a given substring indicated by a and b | \n", "
| count(m,a(optional),b(optional)) | \n", "number of occurrences of m within the substring indicated by a and b | \n", "