The correct code snippet that defines a function which accepts two numbers, subtracts them, and returns the difference is:
def subtract(a,b):
return(a-b)
This function takes two arguments, a
and b
, and returns the result of a - b
.
Responses
def subtract(a,b):
return(a,b)
def subtract(a,b): return(a,b)
def subtract(a,b):
return(b)
def subtract(a,b): return(b)
def subtract(a,b):
return(a-b)
def subtract(a,b): return(a-b)
def subtract(a,b):
return(a)
1 answer
The correct code snippet that defines a function which accepts two numbers, subtracts them, and returns the difference is:
def subtract(a,b):
return(a-b)
This function takes two arguments, a
and b
, and returns the result of a - b
.