3 Matching Annotations
  1. Feb 2024
  2. Sep 2020
    1. Chapter 12Tuples

      tuples is a sequence of values this can be anytype and they are indexed by integers and tuples are immutable in().operations like addition ,multiplication works on tuples.they can return multiple values. Tuples are immutable which means you cannot update or change the values of tuple elements. An operation that collects multiple arguments into a tuple is known as gather. an operation that makes a sequence behaves like multiple arguments is known as scatter. .And the tuples we cannot modify the values. and we can assign the values to the tuples.

    2. A tuple is a sequence of values. The values can be any type, and they are indexed byintegers, so in that respect tuples are a lot like lists. The important difference is that tuplesare immutable
      • A tuple is a sequence of values. The values can be any type, and they are indexed by integers, so in that respect tuples are a lot like lists. The important difference is that tuples are immutable.
      • Strictly speaking, a function can only return one value, but if the value is a tuple, the effect is the same as returning multiple values.
      • Dictionaries have a method called items that returns a sequence of tuples, where each tuple is a key-value pair.
      • zip object:The result of calling a built-in function zip; an object that iterates through a sequence of tuples
      • .iterator:An object that can iterate through a sequence, but which does not provide list operators and methods.
      • data structure:A collection of related values, often organized in lists, dictionaries, tuples,