+ 1
What does def do again?
2 Réponses
+ 4
def "def"ines the name of a new function.
def add(x, y): <--- We're defining a function that adds two numbers together and naming it "add"
return x+y <--- returns the value of our two numbers added together
print(add(4, 7)) <--- asks our program to print the value returned by our function named "add"
+ 2
I had a hunch that was the case. Thanks very much. I appreciate it.