Tuples - Python for Data Science | Creating, Indexing, Slicing Tuples | Tuple Methods

Pubblicato il: 19 ottobre 2020
sul canale di: Tech Programmer
45
like

In this video, I explain how we can create tuple data types and how we can index elements of a tuple. Tuples also support slicing operations like List datatypes. The only difference is that tuples are immutable data structures and offer very few methods because we cannot modify elements of the tuple.

Further, we look at tuple function to create tuples. This allows to pass any iterable data types into this function and it will convert that iterable into a tuple object.
Indexing tuple elements is very similar to lists. We can also slice a piece of tuple using slicing operations.

I teach about iterating tuples using for loops. We learn about how we can search for a specific element using index method and the in operator.

Tuples also allow unpacking elements of the tuple. This provides elegant solution to assign elements to multiple variables in a single statement. This feature also enables Python tuples to easily swap two variables in single line of code.

Create a Tuple [0:19]
Indexing Tuple Elements in Python [3:13]
Slicing Tuples [5:14]
Iterating Python Tuples [6:41]
Tuple Methods [8:04]
In operator in Python [9:41]
Unpacking Tuples [11:37]

If you like our content, click on SUBSCRIBE button and click on Bell icon to receive latest and greatest updates of my video lessons.

Follow us on Facebook, Twitter, Instagram

Facebook Link:   / techprogrammer1  
Twitter Link:   / techprogrammer1  
Tumblr Blog: https://www.tumblr.com/blog/techprogr...


In questa pagina del sito puoi guardare il video online Tuples - Python for Data Science | Creating, Indexing, Slicing Tuples | Tuple Methods della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Tech Programmer 19 ottobre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 45 volte e gli è piaciuto like spettatori. Buona visione!