1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| #!/bin/python3
if __name__ == '__main__':
# number of strings user will provide
numStrings = int(input())
count = 0
strings = []
# get strings from user and append to strings array
while count != numStrings:
s = str(input())
strings.append(s)
count+=1
x = 0
evens = ""
odds = ""
# loop through elements in strings array
while x < len(strings):
y = 0
# loop through characters in element
while y < len(strings[x]):
if y%2==0:
evens+=strings[x][y]
else:
odds+=strings[x][y]
y+=1
print("{} {}".format(evens,odds))
evens = ""
odds = ""
x+=1
|