Home > database >  VS Code run button doesnt work when using def python3
VS Code run button doesnt work when using def python3

Time:09-16

As the title says when I try to run my code in vs code with the "run code button" when it contains a function like

    def plus(x,y):
        return x y

it doesn't run. However, if I just use for example

    print("hello")

it runs smoothly and prints hello as expected. Thanks in advance.

CodePudding user response:

This should work:

def plus(x,y):
    return x y
print(plus(1, 2))

plus is just a function, and no function caller. Then print("helloword") is a statement.

CodePudding user response:

i would suggest that you reinstall your vs code, it should work

  • Related