bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch
Learn/Python/Foundations Practice
Python•Foundations Practice

Python - Join Tuples

Join Two Tuples

To join two or more tuples you can use the + operator:

Example

Join two tuples:

Formula

tuple1 = ("a", "b" , "c")
tuple2 = (1, 2, 3)
tuple3 = tuple1 + tuple2 print(tuple3)

Multiply Tuples

If you want to multiply the content of a tuple a given number of times, you can use the * operator:

Example

Multiply the fruits tuple by 2:

Formula

fruits = ("apple", "banana", "cherry")
mytuple = fruits * 2 print(mytuple)

Previous

Python - Loop Tuples

Next

Python - Tuple Exercises