Inconsistent output in standard console input and output when executing programs #14913

Open
opened 2026-01-31 04:23:03 +00:00 by claunia · 0 comments
Owner

Originally created by @litesam on GitHub (Aug 20, 2021).

Windows Terminal version (or Windows build number)

Microsoft Windows [Version 10.0.19043.1165]

Other Software

vim 8.1.2269 (inside WSL2)

Steps to reproduce

I have a file named print_yes_if_even_else_no.py which should just run a test on the user inputted numbers and print yes if even and no if odd.
code for it:

tests = int(input())
for _ in range(tests):
    x = int(input())
    if x % 2 == 0:
        print('YES')
    else:
        print('NO')

Input to the code:

20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

(copy paste it into the console on execution)

Expected Behavior

it should be printing each 'YES'/'NO' after its input
image

Actual Behavior

but it prints the result with weird line breaks.
image

Originally created by @litesam on GitHub (Aug 20, 2021). ### Windows Terminal version (or Windows build number) Microsoft Windows [Version 10.0.19043.1165] ### Other Software vim 8.1.2269 (inside WSL2) ### Steps to reproduce I have a file named `print_yes_if_even_else_no.py` which should just run a test on the user inputted numbers and print `yes` if even and `no` if odd. code for it: ```python tests = int(input()) for _ in range(tests): x = int(input()) if x % 2 == 0: print('YES') else: print('NO') ``` Input to the code: ``` 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ``` (copy paste it into the console on execution) ### Expected Behavior it should be printing each 'YES'/'NO' after its input ![image](https://user-images.githubusercontent.com/34811358/130225024-c2dc2792-9396-4f4f-9121-f8d589cb3c3d.png) ### Actual Behavior but it prints the result with weird line breaks. ![image](https://user-images.githubusercontent.com/34811358/130225220-45f9cac7-6394-4187-8853-901678b6a73e.png)
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 04:23:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14913