Guest User

Untitled

a guest
Feb 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import sys
  2.  
  3. # To store no of test cases here (2).
  4. t = int(sys.stdin.readline()) #
  5. # To store input here (0 1 1) and (0 1 2).
  6. l = []
  7.  
  8. while t:
  9. # To store the size of array here (3).
  10. n = int(sys.stdin.readline())
  11. # Here i have used sys.stdin.readline() to take input 0 1 1 than split to get a= ['0','1','1'].
  12. a = (sys.stdin.readline().split())
  13. # Now converting a= ['0','1','1'] to l = [0,1,1]
  14. for i in range(0, n):
  15. b = int(a[i])
  16. l.append(b)
  17. # Do your job with the list l here just print !
  18. print(l)
  19. l = [] # empty list for next input ie (0 1 2).
  20. t = t - 1
Add Comment
Please, Sign In to add comment