Sublime Forum

Function issues

#1

len() function doesn’t implement any result in Sublime text3

0 Likes

#2

Could you be more specific with what you’re trying to achieve?

0 Likes

#3

i just tested the function simply
test = [‘a’, ‘b’, ‘c’, ‘d’]
len(test)

and no output

0 Likes

#4

Unless you’re running your code in a Python REPL, you only get output that you ask for. Saving and running a Python file does not use the REPL.

A statement like len(test) calculates the length of test, but that’s all. If you want to see the result, print(len(test)) calculates the length of test, and then displays it.

This isn’t specific to Sublime Text at all, it’s how Python works.

1 Like

#5

thanks but issue was solved.

once again, thanks for your advises.

0 Likes