1

According to Stack Overflow and Quora, a semicolon at the end of a Python statement does nothing. When I type dir() at the IPython prompt, I see a list of variables in my namespace. If I type dir();, however, I see nothing. What could explain this?

I am getting to know Python 3.7 using Spyder, installed using Anaconda.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user2153235
  • 388
  • 1
  • 11
  • 1
    It’s an [IPython-specific feature](https://ipython.org/ipython-doc/dev/interactive/tips.html#suppress-output). You won’t see the same behaviour in the normal Python REPL, for example. – Ry- Jun 13 '19 at 01:15
  • @JonathonReinhart: Just weighing whether where I got it from is a good duplicate :) – Ry- Jun 13 '19 at 01:17
  • What is the canonical question? The two existing duplicates are too specific (two specific problems, not about the general-used feature of using semicolon to suppress output). – Peter Mortensen Nov 22 '22 at 20:45

0 Answers0