[Python] Different outputs depending on different IDE used?

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    So I'm learning Python in a Coursera Google course, which provides instructional code inside a Jupyter notebook page. But in addition to the Jupyter page, I primarily use the IDLE Shell and scratchpad (downloaded from Python.org) as my main IDE to run programs. The output is generally identical when copy/pasting code between these two environments.

    But this one code chunk produces different output between the two environments. In the Jupyter it provides all the pairings, line-by-line, all the way down. But the IDLE Shell does not print out anything; its totally blank, despite being a precise copy/paste. I can't make sense of these different results. I have really tried to make sure there was no typo anywhere. Any ideas? Thanks

    dominoes = []
    for left in range(7):
    for right in range(left, 7):
    dominoes.append((left, right))
    dominoes

    Continue reading...

Compartilhe esta Página