Skip to main content

Python Tuples and Sets

Body

In this tutorial you will learn:

  • Python Tuples
  • Python Sets
  • Difference between Lists, Tuples and Sets
  • Accessing elements in Tuples and Sets
  • Adding elements in Tuples and Sets
  • Updating elements in Tuples and Sets
  • Removing elements from Tuples and Sets

Python Tuples

Tuple is simply a collection of immutable Python objects it means that those objects cannot be changed. One of the properties of Tuples is that they are ordered. In order to make a Tuple in Python we use round brackets.

For example:

  1. <p>emptyTuple = () #declares an empty Tuple&#13;
  2. tupleOfNumbers = (7</p>

Add new comment

Screenshot