1-introduction

Python Programming - Multithreading, OOP, NumPy and Pandas

۸۵ ویدیو
Farnaz Baghban -۸۵ / ۲۰

5. Returning multiple values

۰ نظر گزارش تخلف
Farnaz Baghban
Farnaz Baghban

#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.



==================================

نظرات

در حال حاضر امکان درج نظر برای این ویدیو غیرفعال است.

توضیحات

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.



==================================