IT45200

Untitled

May 3rd, 2020
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def f():
  2.     lst = []
  3.     while True:
  4.         try:
  5.             elem = int(input('Enter the tuple elements : '))
  6.             lst.append(elem)
  7.         except ValueError:
  8.             break
  9.     for i in range(len(tuple(lst))):
  10.         print("tuple1[%d] = %d" % (i, tuple(lst)[i]))
  11.  
  12. f()
Advertisement
Add Comment
Please, Sign In to add comment