So I tried using a len function to display the length of a list. It just doesnt display the number unless i print it.
Is there something I need to do?
Im sorry I am new to this
So I tried using a len function to display the length of a list. It just doesnt display the number unless i print it.
Is there something I need to do?
Im sorry I am new to this
This is expected behaviour.
Outside of specific environments such as a REPL (Read Evaluate Print Loop) that prompt you for a line of code at a time, executing it and printing the result, programs only do what you tell them to.
As such, if you want to see output such as the value of variables or the result of function calls, you need to tell the program to print it.
The SublimeREPL package does something like this, but it’s rather old, unmaintained and be a bit difficult to use.
If the idea is that you want to just execute ad-hoc Python code inside of Sublime, you can set that up by using the Terminus
package, though. You just need to construct a build system that executes python -i
.