Answers for "intialising a tuple in python"

0

intialising a tuple in python

#Initialising an empty tuple
my_tuple = ()
#OR
my_tuple = tuple()

#Initialising elements in a tuple
my_tuple = (1,) #Single element initialization
#OR
my_tuple = (1, 2) #Multi-element initialization
#OR
my_tuple = (1, 2, "Dog") #Multi-type initialization
Posted by: Guest on January-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language