You are viewing a single comment's thread. Return to all comments →
In Python:
def index_characters(string): evens = [letter for index, letter in enumerate(string) if index % 2 == 0] odds = [letter for index, letter in enumerate(string) if index % 2 != 0] print("".join(evens), "".join(odds)) if __name__ == "__main__": n = int(input()) for _ in range(n): string = input() index_characters(string)
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 →
In Python: