Working with Function :

imaginor-labs 15 June 19
Technology Comments

This is the continuation of series of blog post on getting started to data science using python . So today will explore the building blocks of python with special emphasis on function :

A function is a block of code which runs when it is called.

You can pass data, known as parameters, into a function.

A function can return data as a result.

Custom function is created with def() :

imag1
imag2
imag3

Return value : To let a function return a value, use the return statement:

imag4
imag5

Uses of Lamda function :

Lamda is a very useful function in python in which the function can take any number of argument but can only have one expression

imag6
imag7

Lamda function can be very useful if worked with anonyms within a function

imag8

Comments:

Add a Comment:



Recent Posts: