top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Explanation of Functions in Python

Functions in python are block of code which are only used when they are called and it also helps in reusability of code. Functions are also called with no parameters or giving parameters having some return back from the function like information can be passed as arguments.

Initiating a function using def and using pass for initiating an empty function.

# Syntax of Initiating a Function
def func1():
    pass

# Pass is used for initiating an empty function

Lets print something in the function and then call the function.

def func1():
    print('Hamza Khalid')
# Now Call the function below which will give Hamza Khalid as output when executed.
func1()

Now Lets check about arguments / passing parameters in functions.

# Passed 2 paramters a,b in function as arguments
def func1(a, b):
    return a+b
# Printing func1(2,3) in print function becuse it will return a value and 2 and 3 respectively are parameters.
print(func1(2,3))

Functions can be used in many ways and are useful for code reusability.


Regards,

Hamza Khalid

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.

COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page