Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- # To store no of test cases here (2).
- t = int(sys.stdin.readline()) #
- # To store input here (0 1 1) and (0 1 2).
- l = []
- while t:
- # To store the size of array here (3).
- n = int(sys.stdin.readline())
- # Here i have used sys.stdin.readline() to take input 0 1 1 than split to get a= ['0','1','1'].
- a = (sys.stdin.readline().split())
- # Now converting a= ['0','1','1'] to l = [0,1,1]
- for i in range(0, n):
- b = int(a[i])
- l.append(b)
- # Do your job with the list l here just print !
- print(l)
- l = [] # empty list for next input ie (0 1 2).
- t = t - 1
Add Comment
Please, Sign In to add comment