Using ‘for’ loop, you can iterate over the elements of a tuple.
tuple_iteration.py
emp1 = (1, "Krishna", "Gurram")
for elem in emp1:
print(elem)
Output
$python3 tuple_iteration.py
1
Krishna
Gurram
This blog is primarily focus on Java fundamentals and the libraries built on top of Java programming language. Most of the post are example oriented, hope you have fun in reading my blog....:)
No comments:
Post a Comment