Converting Python Objects Into Tuple


☞tuple() is used to convert python objects into tuple.

Syntax :
 
tuple(<iterable_python_object>)
Example :
t1="inspire"
print(tuple(t1))

t2=[10,20,30]
print(tuple(t2))

t3={"A":10, "b":20}
print(tuple(t3))
Output :
('i', 'n', 's', 'p', 'i', 'r', 'e')
(10, 20, 30)
('A', 'b')