You are viewing a single comment's thread. Return to all comments →
Great solution! It's clean. I initially used a loop before learning about slicing
num_strings = int(input().strip()) for i in range(num_strings): S = input().strip() N = len(S) even_chars = "" odd_chars = "" for x in range(N): if x % 2 == 0: even_chars += S[x] else: odd_chars += S[x] print(f"{even_chars} {odd_chars}")
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
Great solution! It's clean. I initially used a loop before learning about slicing