Python Programming: A Step By Step Guide From Beginner To Advance (second edition) by Leonard Eddison

Python Programming: A Step By Step Guide From Beginner To Advance (second edition) by Leonard Eddison

Author:Leonard Eddison [Eddison, Leonard]
Language: eng
Format: azw3
Published: 2018-11-22T16:00:00+00:00


s.join(list) -- opposite of split(), joins the elements in the given list using the string as the delimiter. e.g. '---'.join(['aaa', 'bbb', 'ccc']) -> aaa---bbb---ccc

5.Tuples

With the term “tuple”, we are referring to a sequence of objects that are immutable in Python.

If a tuple is empty, it will appear as the following:

tup1 = ()

If a tuple includes even only one value, we have to include a comma:

tup1 = (1,)

Let’s see some more tuples:

tup1 = ('dog', 'cat', 'fish', 'seal' )

tup2 = (1, 2, 3, 4 )

Tuples can be sliced, concatenated and more, just like strings, but in order to do that, we have to use square brackets:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.