Python Tuples

 



WHAT WE ARE GOING TO LEARN, LET'S KEEP AN EYE :


L1 Introduction

L2 Creating and Accessing Tuples :


     A) Creating tuples
     B) Creating tuples from existing sequence
     C) Accessing tuples

           => Similarity with lists
           => Accessing individual elements
           => Difference from lists
           => immutable types with mutable elements
           => Traversing a tuple
     D) Comparing lists


L3 Tuple Operations :


    A) Joining tuples
          => Repeating or Replicating tuples
    B) Slicing the tuples
          => Comparing tuples

          => Unpacking tuples

          => Deleting tuples


L4 Tuple Functions And Methods :


        1. the len() function
        2. the max() method
        3. the min() method
        4. the sum() method
        5. the index() method
        6. the count() method
        7. the sorted() method
        8. the tuple() method


L5 Indirectly Modifying Tuples :


    A) Using tuple unpacking
    B) Using constructor functions of list and tuples


L6 Nested Tuples :


    A) Accessing individual elements of inner tuple
    B) Functions for nested tuples



L1  INTRODUCTION :


the python tuples are sequences that are used to store a tuple of values of any type. you have learnt in earlier chapters that python tuples are immutable i.e., you cannot change the elements of a tuple in place; python will create a fresh tuple when you make changes to an element of a tuple. Tuple is a type of sequence like strings and lists but it differs from them in the way that lists are mutable but strings and tuples are immutable.


this chapter is dedicated to basic tuple manipulation in python. we shall be talking about creating and accessing tuples, various tuple operations and tuple manipulations through some built-in functions.



L2  CREATING AND ACCESSING TUPLES :


A tuple is a standard data type of python that can store a sequence of values belonging to any type. The tuples are depicted through parenthesis i.e., round brackets, e.g., following are some tuples in python :


( )                                   # empty tuple

(1, 2, 3)                          #tuple of integers

(1, 2, 3, 4.9,7)                #tuple of numbers

('a', 'b', 'c')                      #tuple of characters

(1, 'a', 2, 'b', 3, 'hii')       #tuple of mixed value types

('one', 'two', 'three')       #tuple of strings


Before we proceed and discuss how to create tuples, one thing that must be clear is that Tuples are immutable(i.e., non-modifiable) i.e., you cannot change elements of a tuple in place.



A) CREATING TUPLES :


Creating a tuple is similar to list creation, but here you need to put a number of expressions in parentheses. That is, use round brackets to indicate the start and end of the tuple, and separate the items by commas. for example :


(2, 4, 6)

('abc', 'xyz')

(1, 2, 3.7, 5,)

( )


Thus to create a tuple you can write in the form given below - 


T = ( )

T = (values, ....)


This construct is known as a tuple display construct. consider some more examples -


1) The Empty tuple 


The empty tuple is ( ). it is the tuple equivalent of 0 or''. you can also create an empty tuple as :


T = tuple()


It will generate an empty tuple and name that tuple as T.



2) Single Element tuple


Making a tuple with a single element is tricky because if you just give a single element in round brackets, python considers it a value only, e.g., 


>>> t = (1)

>>> t

1


To consider a tuple with one element just add a comma after the single element as shown below - 


>>> t = 3,

>>> t

(3, )

>>> t2 = (4, )

>>> t2

(4, )



3) Long tuples


If a tuple contains many elements, then to enter such long tuples, you can split it across several lines, as given below -


sqrs = (0, 1, 4, 9, 16, 25, 36

            56, 45, 99, 88)


Notice the opening parenthesis and closing parenthesis appear just in the beginning and end of the tuple.


4) Nested tuples


If a tuple contains an element which is a  tuple itself then it is called nested tuple e.g., following is a nested tuple - 


t1 = (1, 2, 3, 4, (5, 6, 7), 8)


the tuple t1 has three elements in it. the third element of tuple t1 is a tuple itself, hence, t1 is a nested tuple.



  • Creating Tuples From Existing Sequences :


you can also use the built-in tuple type object (tuple( )) to create tuples from sequences as per the syntax given below -


t = tuple(<sequence>)


where <sequence> can be any kind of sequence object including strings, lists and tuples. 


python creates the individual elements of the tuple from the individual elements of passed sequence. if you pass in another tuple, the tuple functions makes a copy.


>>> t1 = tuple('hello')

>>> t1

('h', 'e', 'l', 'l', 'o')

>>> L = ['w', 'e', 'r', 'y']

>>> t2 = tuple(L)

>>> t2

('w', 'e', 'r', 'y')


You can use this method of creating tuples of single characters or single digits via keyboard input. consider the code below - 


t1 = tuple(input('enter tuple elements : '))

enter tuple elements : 234567

>>> t1

('2', '3', '4', '5', '6', '7')


See, with tuple() around input(), even if you not put parenthesis, it will create a tuple using individual characters as elements. But most commonly used method to input tuples is eval(input( )) as shown below - 


tuple = eval(input("enter tuple to be added : "))

print("tuple you entered : ", tuple)


when you execute it, it will work somewhat like - 


enter tuple to be added : (1, 2, ,3 ,4 ,5)

tuple you entered : (1, 2, 3, 4, 5)


If you are inputting a tuple with eval( ), then make sure to enclose the tuple elements in parenthesis. Please note sometimes(not always) eval( ) does not work in python shell. At that time, you can run it though a script too.



B) ACCESSING TUPLES :


Tuples are immutable (non-editable) sequences having a progression of elements. Thus, other than editing items, you can do all that you can do with lists. Thus like lists, you can access its individual elements. Before we talk about that, let us learn about how elements are indexed in tuples.



  • Similarity with lists - 


Tuples are very much similar to lists except for the mutability. In other word, Tuples are immutable counter-parts of lists. Thus, like lists, tuple-elements are also indexed, i.e., forward indexing as 0, 1, 2, 3, 4 ... and backward indexing as -1, -2, -3, -4 ....



Thus you can access the tuple elements just like you access a list or a string's elements e.g., Tuple[i] will give you element at ith index; Tuple[a:b] will give you elements between indexes a to b-1 and so on.


Put in other words, tuples are similar to lists in following ways - 


=> Length - function len(T) returns the number of items (count) in the tuple T.

=> Indexing and Slicing - 

T[i] returns the item at index i (the first item has index 0),

T[i:j] returns a new tuple, containing the objects between i and j excluding index j,

T[i:j:n] returns a new tuple containing every nth item from index i to j, excluding index j. just like lists.

=> Membership operators - both 'in' and 'not in' operators work on tuples just like they work for other sequences. That is, in tells if an element is present in the tuple or not and not in does the opposite.

=> Concatenation and Replication operators + and * - the + operator adds one tuple to the end of another. the * operator repeats a tuple.



  • Accessing individual elements - 


As mentioned, the individual elements os a tuple are accessed through their indexes given in square brackets just like lists.


>>> vowels = ('a', 'e', 'i', 'o', 'u')

>>> vowels[0]

'a'

>>>vowels[4]

'u'

>>>vowels[-1]

'u'

>>>vowels[-5]

'a'


just like strings, if you pass in a negative index, Python adds the length of the tuple to the index to get its forward index. That is, for a 6-element tuple T, T[-5] will be internally computed as -


T[-5+6]=T[1]



  • Difference from lists -


Although tuples are similar to lists in many ways, yet there is an important difference in mutability of the two. Tuple are not mutable, while lists are. you cannot change individual elements of a tuple in place, but lists allow you to do so. That is, following statement is fully valid for lists (BUT not for tuples). That is, if we have a list L and a tuple T, then


L[i] = element


is VALID for lists. but


T[i] = element


is INVALID as you cannot perform item-assignment in immutable types.



  • Immutable types with mutable elements - 


So now it is clear to you that immutable type like tuples cannot have item assignment, i.e., you cannot change its elements. But what if a tuple contains mutable elements e.g., a list at its element? in that case, would you be able to modify the list elements of the tuple not ?


If a tuple contains mutable elements such lists or dictionaries, then tuple's elements once assigned will not change, but its individual mutable elements can change their own elements value. To understand, go through the following example. say you have a tuple which stores two elements of list types - 


>>> numbers = ([1, 2, 3],[4, 5, 6])


Internally, the above tuple will store its list elements as shown in adjacent figure. now if you try to modify the elements of tuple numbers by giving a statement like - 


>>> numbers[1] = [1, 2, 0]

Traceback(most recent call last) :

       File"<pyshell#3>", line1, in<module>

          numbers[1] = [1, 2, 0]

TypeError : 'tuple' object does not support item assignment


This is because, the above is trying to change the first element of typle numbers but as tuples are immutable, no matter what, the tuple numbers will always keep referring to its first list element stored at address 8016. That is the address of its first element will always remain 8016. But if you give a statement like,


>>> numbers[0][2]=0


It will give no error. This is because, the tuple numbers' elements' memory addresses are not changed; the tuple numbers is still referring to same python list objects stored at addresses 8016 and 9032 respectively. However, the list stored at address 8016 is now having different elements, which is allowed as lists are mutable and their elements can change. so after the above statement, internally the tuple numbers will be like as shown adjacent figure (as you can see, the addresses of its list elements are unchanged) :


so now if you print the numbers tuples, it will given you results as - 


>>> print(numbers)

([1, 2, 0], [4, 5, 6])



  • Traversing a tuple - 


Recall that traversal of a sequence means accessing and processing each element of it. Thus traversing a tuple also means the same and same is the tool for it, i.e., the python loops. The for loop make it easy to traverse or loop over the items in a tuple, as per following syntax - 


for<item> in <tuple> :

      process each item here


For example, following loop shows each item of a tuple T in separate lines -


T = ('p', 'y', 't', 'h', 'o', 'n')

for a in T :

        print(T[a])


The above loop will produce result as : 

p

y

t

h

o

n



How it works - 


the loop variable a in above loop will be assigned the tuple elements, one at a time. so, loop-variable a will be assigned 'p' in first iteration and hence 'p' will be printed; in second iteration, a will get element 'y' and 'y' will be printed; and so on.


If you only need to use the indexes of elements to access them, you can use functions range( ) and len( ) as per following syntax - 


for index in range(len(T)) :

       process Tuple[index] here



L3 TUPLE OPERATIONS  :


The most common operations that you perform with tuple include joining tuples and slicing tuples. In this section, we are going to talk about the same.



A) JOINING TUPLES - 


Joining two tuples is very easy just like you perform addition. The + operator. the concatenation operator, when used with two tuples, joins two tuples. consider the example given below - 


>>> t1 = (1, 3, 5)

>>> t2 = (6, 7 ,8)

>>> t1 + t2

(1, 3, 5, 6, 7, 8)


As you can see that the resultant tuple has firstly elements of first list1 and followed by elements of second tuple list2. you can also join two or more tuples to form a new tuple, e.g.,


>>> t1 = (10, 12, 14)

>>> t2 = (20, 22, 24)

>>> t3 = (30, 32, 34)

>>> tuple = t1 + t2 + t3

>>> tuple

(10, 12, 14, 20, 22, 24, 30, 32, 34)


The + operator when used with tuples requires that both the operands must be of tuple types. You cannot add a number or any other value to a tuple. For example, following expressions will result into error - 


tuple + number

tuple + complex-number

tuple + string

tuple + list


consider the following example - 


>>> t1 = (10, 12, 14)

>>> t1 + 2

:

TypeError : can only concatenate tuple(not "int") to tuple

>>> t1 + "abc"

:

TypeError : can only concatenate tuple(not "str") to tuple


The tuples being immutable, expand to a = a+b for a+=b, where both a and b, are tuples.



  • IMPORTANT - 


Sometimes you need to concatenate a tuple(say T) with another tuple containing only one element. In that case, if you write statement like - 


>>> T + (3)


python will return an error like - 


:

TypeError : can only concatenate tuple(not "int") to tuple


The reason for above error is that a number enclosed in () is consider number only. To make it a tuple with just one element, just add a comma after the only element, i.e., make it(3,). Now python won't return any error and successfully concatenate the two tuples.


>>> t = (10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> t + (3,)

(10, 12, 14, 20, 22, 24, 30, 32, 34, 3)



  • Repeating or replicating tuples -


like strings and lists, you can use * operator to replicate a tuple specified number of times, e.g., if t1 is (1, 3, 5), then


>>> t1*3

(1, 3, 5, 1, 3, 5, 1, 3, 5)



B) SLICING THE TUPLES - 


Tuple slices, like list-slices or string slices are the sub parts of the tuple extracted out. you can use indexes of tuple elements to create tuple slices as per following format - 


seq = T[start:stop]


the above statement will create a tuple slice namely seq having elements of tuple T on indexes start, start+1, start+2, ..., stop-1. Recall that index on last limit is not included in the tuple slice. the tuple slice is a tuple in itself that is you can perform all operations on it just like you perform on tuples. consider the following example - 


>>> tpl = (10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> seq = tpl[3:-3]

>>> seq

(20, 22, 24)


For normal indexing, if the resulting index is outside the tuple, python raises an IndexError exception. Slices are treated as boundaries instead, and the result will simply contain all items between the boundaries. For the start and stop given beyond tuple limits in a tuple slice, python simply returns the elements that fall between specified boundaries, if any. for example - 


>>> tpl = (10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> tpl [3:30] 

(20, 22, 24, 30, 32, 34)

>>> tpl[-15:7]

(10, 12, 14, 20, 22, 24, 30)


tuples also support slice steps too. That is, if you want to extract, not consecutive but every other element of the tuple, there is a way out - the slice steps. The slice steps are used as per following format -


seq = T[start:stop:step]


for example - 


>>> tpl

(10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> tpl[0:10:2]

(10, 14, 22, 30, 34)

>>> tpl[2:10:3]

(14, 24, 34)

>>> tpl[::3]

(10, 20, 30)


consider more examples to understand this - 


seq = T[::2]     # get every other item, starting with the first

seq = T[5::2]   # get every other item, starting with the

                       # sixth element, i.e., index 5


you can use the + and * operators with tuple slices too. For example, if a tuple namely Tp has values as (2, 4, 5, 7, 8, 9, 11, 12, 34), then :


>>> tp[2:5]*3

(5, 7, 8, 5, 7, 8, 5, 7, 8)

>>> tp[2:5]+(3, 4)

(5, 7, 8, 3, 4)



  • Comparing Tuple -


you can compare two tuples without having to write code with loops for it. for comparing two tuples, you can using comparison operators, i.e., <, >, ==, != etc. for comparison purposes, python internally compares individual elements of two tuples, applying all the comparison rules that you have read earlier.


>>> a = (2, 3)

>>> b = (2, 3)

>>> a == b

True

>>> c = ('2', '3')

>>> a == c

False

>>> a > b

False

>>> d = (2.0, 3.0)

>>> d> a

False

>>> d == a

True

>>> e = (2, 3, 4)

>>> a < e

True



  • Unpacking Tuples -


creating a tuple from a set of values is called packing and its reverse, i.e., creating individual values from a tuple's elements is called unpacking. unpacking is done as per the following syntax - 


<variable1>, <variable2>, <variable3>, ...= t


where the number of variables in the left side of assignment must match the number of elements in the tuple. for example -


t = (1, 2, 'A', 'B')


the length of above tuple t is 4 as there are four elements in it. now to unpack it, we can write - 


w, x, y, z = t



  • Deleting tuples - 


the del statement of python is used to delete elements and objects but as you know that tuples are immutable, which also mean that individual elements of a tuple cannot be deleted, i.e., if you give a code like -


>>> del t1[2]


then python will give you a message like -


Traceback(most recent call last):

  File"<ipython-input-83-cad7b2ca8ce3>", line1, in<module>

    del t1[2]

TypeError: 'tuple' object doesn't support item deletion


but you can delete a complete tuple with del statement as :


del<tuple_name>


for example - 


>>> t1 = (5, 7, 3, 9, 12)

>>> t1

(5, 7, 3, 9, 12)

>>> del t1

>>> print(t1)

Traceback(most recent call last):

  File"<ipython-input-83-cad7b2ca8ce3>", line1, in<module>

    print(t1)

NameError: name 't1' is not defined



L4 TUPLE FUNCTIONS AND METHODS :


python also offers many built-in functions and methods for tuple manipulation. you have already worked with one such method len() in earlier chapters. in this section, you will learn about many other built-in powerful tuples methods of python used for tuple manipulation. let us now have a look at some useful built-in type manipulation methods.



1) The len() function :


this method returns length of the tuple, i.e., the count of elements in the tuple. syntax -


len(<tuple>)


>>> employee = ('john', 10000, 24, 'sales')

>>> len(employee)

4



2) The max() function :


this method returns the element from the tuple having the maximum value. syntax -


max(<tuples>)


>>> tpl = (10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> max(tpl)

34

>>> tpl2 = ("karan", "zubin", "zara", "ana")

>>> max(tpl2)

'zubin'


please note that max(0 applied on sequences like tuples/lists etc. will return a maximum value ONLY IF the sequence contain values of the same type. if your tuple contains values of different datatypes then, it will give you an error stating that mixed type comparison is not possible - 

a)

>>> ab = (1, 2.5, "1",[3, 4], (3, 4))

>>> max(ab)

:

TypeError: '>' not supported between instances of 'str' and 'float'


b)

>>> ab = ([3, 4], (3, 4))

>>> max(ab)

:

TypeError: '>' not supported between instances of 'tuple' and 'list'



3) The min() function - 


this method returns the element from the tuple having the minimum value. syntax - 


min(<tuple>)


>>> tpl = (10, 12, 14, 20, 22, 24, 30, 32, 34)

>>> min(tpl)

10

>>> tpl2 = ("karan", "zubin", "zara", "ana")

>>> min(tpl2)

'ana'


like max(), for min() to work, the elements of tuple should be of same type.



4) The sum() function - 


the sum() function takes the tuple sequence and returns the sum of the elements of the tuple. for sum() to work, the tuple must have numeric elements. function sum() works as per the following syntax - 


sum(<tuple>)


>>> val = (27, 34, 25, 40)

>>> sum(val)

126



5) The index() method - 


the index() works with tuples in the same way it works with lists. that is, it returns the index of an existing element of a tuple. it is used as -


<tuplename> . index(<item>)


>>> t1 = [3, 4, 5, 6.0]

>>> t1.index(5)

2


but if the given item does not exist in tuple, it raises ValueError exception.



6) The count() method - 


the count() method returns the count of a member/object in a given sequence (list/tuple). you can use the count() function as per the following syntax -


<sequence name>.count(<object>)


>>> t1 = (2, 4, 2, 5, 7, 4, 8, 9, 9, 11, 7, 2)

>>> t1.count(2)

3

>>> t1.count(7)

2

>>> t1.count(11)

1


for an element not in tuple, it returns 0.



7) The sorted() function - 


this function takes the name of a tuple as an argument and returns a new sorted list with new sorted elements in it. it works as per the following syntax - 


sorted(<iterable_sequence>, [reverse = False])


where,

=> <iterable sequence> is the tuple to be sorted

=> argument reverse is optional and takes a boolean value. if reverse argument is missing(or set to False), then the tuple elements are sorted in ascending order. if reverse argument is set to True, then the tuple elements are sorted in the reverse order(descending). for example -


>>> val = (27, 34, 25, 40)

>>> sval = sorted(val)

[25, 27, 34, 40]

>>> rsval = sorted(val, reverse = True)

>>> rsval

[40, 34, 27, 25]


please note that the sorted() function will always output the result of list type.



8) The tuple() method - 


this method is actually the constructor method that can be used to create tuples form different types of values. it works as per the following syntax - 


tuple(<sequence>)


creating empty tuple

>>> tuple()

()


creating tuple from a string

>>> t = tuple("abc")

>>> t

('a', 'b', 'c')


creating a tuple from a string

>>> t = tuple([1, 2, 3])

>>> t

(1, 2, 3)


creating a tuple from keys of a dictionary

>>> t1 = tuple({1:"1", 2:"2"})

>>> t1

(1, 2)


as you can notice that, python has considered only the keys of the passed dictionary to create tuple. but one thing that you must ensure is that the tuple() can receive argument of iterable sequence type only, i.e., either a string or a list or even a dictionary. any other type of value will lead to an error. see below -


>>> t = tuple(1)

:

TypeError : 'int' object is not iterable


the tuple() and list() are construction that let you create tuples and lists respectively from passed sequence. This feature can be exploited as a trick to modify tuple, which otherwise is not possible. following section talks about the same.



L5 INDIRECTLY MODIFYING TUPLES :


tuples are immutable counterparts of lists. if you need to modify the contents often of a sequence of mixed types, then you should go for lists only. however if you want to ensure that a sequence of mixed types is not accidently changed or modified, you go for tuples. but sometimes you need to retain the sequence as tuple and still need to modify the contents at one point of time, then you can use one of the two methods given here -



A) Using Tuple Unpacking  -


tuples are immutable. to change a tuple, we would need to first unpack it, change the values, and then again repack it :


tpl = (11, 33, 66, 99)


1. first unpack the tuple - 

a, b, c, d = tpl


2. redefine or change desired variable say, c

c = 77


3. now repack the tuple with changed value

tpl = (a, b, c, d)



B) Using The Constructor Functions Of Lists And Tuples i.e., list( ) And tuple( ) -


there is another way of doing the same as explained below - 


>>> tpl = ("Anand, 35000, 35, "Admin")

>>> tpl

("Anand", 35000, 35, "Admin")


1) convert the tuple to list using list():

>>> lst = list(tpl)

>>> lst

["Anand, 35000, 35, 'Admin'"]


2) Make changes in the desired element in the list -

>>> lst[1] = 45000

>>> lst

["Anand", 45000, 35, 'Admin']


3) Create a tuple from the modified list with tuple() -

>>> tpl = tuple(lst)

>>> tpl

['Anand', 45000, 35, 'Admin']



L6 NESTED TUPLES :


like lists, you can have nested tuples too. a tuple containing another tuple in it as a member is called a nested tuple, e.g., the tuple shown below is a nested tuple -


student = (11, 'Ria', (67, 77, 78, 82, 80))


so, the student tuple shown above is a nested tuple whose 3rd element, i.e., student[2] is a tuple and the total number of elements in student tuple(i.e., len(student)) is 3.


>>> student = (11, 'Ria', (67, 77, 78, 82, 80))

>>> len(student)

 

the len(student) returned 3 because each inner tuple is treated as one element and thus it returned 3 as the tuple student contains 3 elements - 11, 'Ria' and a tuple (67, 77, 78, 82, 80).



A) Accessing Individual Elements Of Inner Tuple - 


to access the inner tuple element of the above shown tuple, you can use student[2] as the inner tuple is at the 3rd position(index2) in the tuple - 


>>> student[2]

(67, 77, 78, 82,80)


to access individual elements of the inner tuple, you can use index along with student[2], which is the identity of the inner tuple. for example,


to access the 1st element (index 0) of inner tuple, student[2], you may write -


>>> student[2][0]

67


to access the 3rd element (index 0) of inner tuple, student[2], you may write -


>>> student[2][2]

78


to access the 4th element (index 0) of inner tuple, student[2], you may write - 


>>> student[2][3]

82



B) Functions For Nested Tuples -


Most tuple functions will work for the nested tuple as well except for a few.


functions that work for all nested tuples - len(), count(), index()


functions len(), count(), index() will work for nested tuples normally, e.g.,


>>> tp2 = 1, (2, 3, 4), 5, (6, 7)

>>> len(tp2)

4

>>> tp2.index(5)

2

>>> tp2.index((6, 7))

3

>>> tp2.count(3)

0

>>> tp2.count(5)


functions that works for nested tuples having only tuples as elements - max() and min() 


you can use max() and min() on only those nested tuples which have all the elements as tuples, otherwise python will give you a TypeError.


>>> max(tp2)

Traceback(most recent call last) :

      max(tp2)

TypeError: '>' not supported between instance of 'tuple' and 'int'


but if you have tuples that contain tuples as elements, the min() and max() functions will work with them, e.g.,


>>> tp3 = (2, 3, 4), (4, 5, 6)

>>> tp4 = (1, 2), (2, 3, 4), (5, 6, 7, 8)

>>> min(tp3)

(2, 3, 4)

>>> min(tp4)

(1, 2)

>>> max(tp3)

(4, 5, 6)

>>> max(tp4)

(5, 6, 7, 8)


=> functions that do not work for nested tuples : sum()


function sum() cannot work with nested tuples as they have at least one tuple as element and tuples cannot be added with other element types. Thus, using sum() with a nested tuple will raise a error, e.g.,


>>> tp2 = 1, (2, 3, 4), 5, (6, 7)

>>> sum(tp1)

Traceback(most recent call last):

         sum(tp1)

TypeError : unsupported operand type(s) for + : int' and 'str'





Post a Comment

0Comments
Post a Comment (0)

Featured Highlighted Categories

You'll discover all of the most up-to-date bring innovative here.

Python List theory with List Programs
Get complete python lists theory and list basic and insane programs for your practice.
CBSE SAMPLE PAPERS
Get CBSE sample and question papers of last 7 years with answers to get best practice for your Board Exams
Python String theory and String Programs
Python strings complete theory with illustrations and practice programs for free