How to Create a Tuple in Python


In this example we will show how to create a tuple in Python.

Source Code

# the tuples are written with round brackets
my_tuple = ('a', 'b', 1, 2)

print(my_tuple)

Output:

('a', 'b', 1, 2)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments