n = int(input())
for _ in range(n):
string = input()
print(string[0::2], string[1::2])
what the mean of string[0::2], is something like str_split at PHP or different
Asked
Active
Viewed 41 times
0

unknownit
- 5
- 4
-
It's Python slicing notation; you can find more about it [here](https://stackoverflow.com/a/509295) – Ionut Ticus Apr 11 '20 at 12:30
-
That's a slice. https://www.youtube.com/watch?v=L22zs3v6Rtg – CristiFati Apr 11 '20 at 12:30
-
in simple term for any iterable it is start index, end index, and iincrement step – sahasrara62 Apr 11 '20 at 12:38
-
but, why in the code has a 4 property inside string[1::2], if must be 3 start,end, increment. So my code still run and nothing wrong happen. – unknownit Apr 11 '20 at 12:42