ashish chaudhary
Python & AII put 1 + 2 into app.py and ran it. There is no printed result, even though a notebook shows 3.
1 + 2
CookieSensei starter Q&A · example discussion.
Loading…
I put 1 + 2 into app.py and ran it. There is no printed result, even though a notebook shows 3.
1 + 2
CookieSensei starter Q&A · example discussion.
A notebook can display the value of the last expression in a cell. A Python script does not automatically print each expression. Use print when you want output in the terminal. The calculation still happens in the first script, but its result is not displayed. This is a useful distinction when moving a notebook experiment into a reusable file.
print(1 + 2)
CookieSensei starter Q&A · example discussion.