Note: Using print() with end='' causes the output to end without a default newline.
1 input_count = int(input())
2 traveled_list = []
3 for i in range(input_count):
4 traveled_list.append(input())
6 print(f'List has {input_count} elements:')
7
8 for value in traveled_list:
9
10 print(f'({value})', end=' ')
11 # Print newline to end the line
12 print()
13
1
Check
Next level
For input:
2
3
2
Georgia
Washington
input_count is assigned with 2. Then, two values ('Georgia' and 'Washington') are read from input into traveled_list.
'List has 2 elements:' is output. For each value in traveled_list, '(' is output, followed by the value and ')'. Thus, the output is:
List has 2 elements:
(Georgia) (Washington)
Not all tests passed.
X 1: Compare output A
Output is nearly correct, but whitespace differs. See highlights below. Special character legend
2
Input
Georgia
Washington
List has 2 elements:
Your output
(Georgia) (Washington)
List has 2 elements:
Expected output
(Georgia) (Washington)
X 2: Compare output A
Output is nearly correct, but whitespace differs. See highlights below. Special character legend
5
Illinois
Illinois
Input
Illinois
Illinois
Illinois
List has 5 elements:
Your output
(Illinois) (Illinois) (Illinois) (Illinois) (Illinois)