Naar hoofdinhoud
πŸ”’ Voorbeeldmodus. De eerste vijftien Foundations-lessen zijn gratis; deze is Pro. Start een 7-daagse trial om de editor, AI-hints en de rest van het curriculum te ontgrendelen. Kaart vereist, op elk moment opzegbaar in Dashboard.Start 7-daagse trial β†’
⚑
← Cursussenβ€ΊPython FoundationsModule 7 Β· Geavanceerde standaardbibliotheekβ€Ίsubprocess.run β€” voorspel de uitvoerpredict140 / 174
+100 XP
Opdracht🌐 shown in EN
πŸ“ **Task:** Predict the two lines printed by the program. \`echo "hi"\` prints "hi" + newline (stripped) and exits 0. πŸ“‹ Edit the starter code below. Tests run automatically. πŸ’‘ **Hint:** Re-read the theory if you get stuck.
Voorspel uitvoer

Lees de code zorgvuldig

import subprocess

result = subprocess.run(
    ["echo", "hi"],
    capture_output=True,
    text=True,
    check=True,
)
print(result.stdout.strip())
print(result.returncode)

Wat zal het programma uitprinten? Schrijf hier: