0% found this document useful (0 votes)
17 views1 page

Lists & Tuples: Tensorflow - 23U3Aic03

The document explains Python Lists and Tuples, highlighting that lists are dynamic arrays enclosed in brackets and tuples are collections of objects that can be indexed, often defined using parentheses. It provides examples of both data structures, demonstrating how to create and print them in Python. Lists and tuples can contain elements of any type and are separated by commas.

Uploaded by

veere_arun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Lists & Tuples: Tensorflow - 23U3Aic03

The document explains Python Lists and Tuples, highlighting that lists are dynamic arrays enclosed in brackets and tuples are collections of objects that can be indexed, often defined using parentheses. It provides examples of both data structures, demonstrating how to create and print them in Python. Lists and tuples can contain elements of any type and are separated by commas.

Uploaded by

veere_arun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

TENSORFLOW – 23U3AIC03

LISTS & TUPLES


Python Lists are just like dynamically sized arrays, declared in other languages (vector
in C++ and ArrayList in Java). In simple language, a list is a collection of things, enclosed in [ ]
and separated by commas.

Example of the list in Python


Here we are creating a Python List using [].

Var = ["Geeks", "for", "Geeks"]


print(Var)

Output: ["Geeks", "for", "Geeks"]

Python Tuple is a collection of Python Programming objects much like a list. The
sequence of values stored in a tuple can be of any type, and they are indexed by integers.
Values of a tuple are syntactically separated by ‘commas‘. Although it is not necessary, it is
more common to define a tuple by closing the sequence of values in parentheses. This helps in
understanding the Python tuples more easily.

Creating a Tuple
In Python Programming, tuples are created by placing a sequence of values separated
by ‘comma’ with or without the use of parentheses for grouping the data sequence.

Example:
Tuple1 = ('Geeks', 'For')
print("\nTuple with the use of String: ")
print(Tuple1)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy