NelsonGon
NelsonGon

Reputation: 13319

How do I use python in sublimetext 3

I've set up python in sublimetext 3 but can't seem to do anything. It simply returns:

[Finished in 0.2s]

What am I doing wrong?

This is what I tried: I have been using spyder but it's too slow. PS: I have anaconda and don't want to use that either.

def new_sum(x,y):
    return(x+y)

new_sum(1,2)

Upvotes: 1

Views: 68

Answers (1)

FrenchMasterSword
FrenchMasterSword

Reputation: 927

You return a value, but you do not print it.

Using the interpreter in interactive mode, if something returns something else than None and isn't placed in a variable, it will be printed. This isn't the case with a script.

It has nothing to do with ST3.

Change new_sum(1,2) to print(new_sum(1,2))

Upvotes: 2

Related Questions