5. Returning multiple values
#3 Python Programming Exercise
Construct a function that has 1 parameter - the x variable. If x is smaller than 0 then return with 0. Otherwise return with +1. (Note: there may be multiple return statements in a given function)
Good luck!
====================================================
#3 Python Programming Exercise
def activation(x):
if x < 0:
return 0
else:
return 1
=================================================
By the way this is a famous activation function in artificial intelligence and machine learning.
==================================
نظرات