Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test(enter):
- x = enter[:len(enter)//2];y = enter[len(enter)//2:]
- xb = 0
- xc = 0
- for index in x:
- xb = xb + int(index)
- for index in y:
- xc = xc + int(index)
- z = xb - xc
- y = xc - xb
- if z == 1 or y == 1:
- return "Yes"
- else:
- return "No"
- Fin = open("INPUT.txt", "r")
- Fout = open ( "OUTPUT.txt", "w")
- Finput = Fin.read().split()
- k = int(Finput[0])
- i = 1
- while i <= k:
- Fout.write(test(Finput[i])+'\n')
- i+= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement