Defining and Calling Python Functions — Real Python

A function is a self-contained block of code that encapsulates a specific task or related group of tasks. This course will show you how to define your own Python function. You’ll learn when to divide your program into separate user-defined functions and what tools you’ll need to do this.
You’ll also learn the various ways to pass data into a function when calling it, which allows for different behavior from one invocation to the next.
In this course, you’ll learn:
How functions work in Python and why they’re beneficial
How to define and call your own Python function
Mechanisms for passing arguments to your function
Some differences between how to work with functions in Python vs C++
How to return data from your function back to the calling environment
This course will be the most helpful for you if you’re already familiar with the fundamental concepts of Python, including basic data types, lists and tuples, dictionaries, the import statement, conditional statements, and for loops.

Source link

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Art of Communicating Meaning with HTML Elements Beyond Just Presentation

Communicating meaning.

Pushing past the fear: My Udacity Grow With Google learning journey

Announcing LiNEAR’s integration with The Graph to Bring Superior Data Indexing and Querying

Featured Story: Resolving the curve of team adoption of agile

I am guilty of this one. When our cat had cancer, I told my daughter

Introduction to OpenCV

Case study: Network bottlenecks on Linux: Part 1 — The NIC

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Digital Marketing

Digital Marketing

More from Medium

How to be Basic in Python

Notepad using Tkinter

Turning objects lazy in Python

Getting started with Python