Python Tuples Access

Published: 29 March 2021
on channel: NetworkShip
89
1

How to access tuple items? To access a tuple item, we will use python index operator. In this lesson, we will use different tuple examples and access differetn items in a python tuple.

Let's give some examples:


Example 1:
*****************************************************************

cars = ("BMW", "Audi", "Mercedes")
print(cars[1])

Output:
Audi


Example 2:
*****************************************************************

cars = ("BMW", "Audi", "Mercedes", "Alfa Romeo", "Aston Martin", "Porche")
print(cars[2:5])

('Mercedes', 'Alfa Romeo', 'Aston Martin')

*****************************************************************

Vor more examples, visit:
Tuple Access Lesson: https://ipcisco.com/lesson/python-tup...
.
Full Python Programming Course: https://ipcisco.com/course/python-pro...
.
#pythontuples #python3 #pythonlearning #pythoncourse #pythonexamples


On this page of the site you can watch the video online Python Tuples Access with a duration of hours minute second in good quality, which was uploaded by the user NetworkShip 29 March 2021, share the link with friends and acquaintances, this video has already been watched 89 times on youtube and it was liked by 1 viewers. Enjoy your viewing!