-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathP04_STRHH.py
35 lines (34 loc) · 904 Bytes
/
P04_STRHH.py
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
33
34
35
# Given a sequence of 2*k characters, please print every second character from the first half of the sequence. Start
# printing with the first character.
#
# Input
#
# In the first line of input your are given the positive integer t (1<=t<=100) - the number of test cases. In the each of the next t lines, you are given a sequence of 2*k (1<=k<=100) characters.
#
# Output
#
# For each of the test cases please please print every second character from the first half of a given sequence
# (the first character should appear).
#
# Example
#
# Input:
# 4
# your
# progress
# is
# noticeable
#
# Output:
# y
# po
# i
# ntc
# Submit solution!
testCases = int(input())
for _ in range(testCases):
string = input()
check = len(string) // 2 # split the length of string in two halves
for i in range(0, check, 2):
print(string[i], end = '')
print()