Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter seems to only print out the last out of all cells #194

Open
sirtosti opened this issue Nov 29, 2017 · 4 comments
Open

Jupyter seems to only print out the last out of all cells #194

sirtosti opened this issue Nov 29, 2017 · 4 comments

Comments

@sirtosti
Copy link

in this small python code , only the last result is output when use "Ctrl + enter" or cell-->"run all"

here is the little code:

"alphabetical".isupper()
"alphabetical".islower()
"alphabetical".istitle()
"alphabetial".isdigit()

False -----So, this line is the output of "alphabetial".isdigit()" and it didn't execute the other three.

@dzbee
Copy link

dzbee commented Nov 30, 2017

This is typical notebook behavior. The others did execute, but the cell only prints the result of the last evaluation to console. If you put print statements in front of each line, all them will print.

@sirtosti
Copy link
Author

sirtosti commented Dec 1, 2017 via email

@dzbee
Copy link

dzbee commented Dec 1, 2017

Jupyter/IPython will only print the result of the last evaluation in a cell to console unless explicitly told to print the result of an evaluation by the print command. It doesn't matter whether the expression is a Boolean or a complicated function. This is a general Jupyter/IPython behavior. As I said before, if you put print statements in front of each line, all of them will print. You could also split them into separate cells and all of them will print. I would highly suggest looking at a Jupyter notebook tutorial if you are confused about what's happening here.

@sirtosti
Copy link
Author

sirtosti commented Dec 1, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants