How to Code PYTHON: *Return Function and Variable Scope in Python*

Veröffentlicht am: 27 Januar 2021
auf dem Kanal: Coding With Kids
196
9

Let's get started! 🔥🔥🔥 In this video, we will write a few PYTHON 🐍 scripts to demonstrate how to define and use functions ♻️. In the examples, we create a function that returns a single value by using the return keyword, then we add a new function that returns a list. Finally, we write a new function that demonstrates variable scope in a function to help you understand the scope of variables declared both inside and outside a function. In this tutorial, you will learn some basics in about 5 minutes!

In this video, you will learn how to:
★ 0:09 Function that returns a value
★ 1:19 Function that returns a list
★ 3:06 Function that demonstrates variable scope in a function

Tips and Tricks:
► Capture the returned value of a function by assigning it to a variable.
► Returned value of a function can also be a list that contains multiple values.
► Scope is a value's accessibility inside and outside a code structure like a function's code block.
► Value cannot be accessed outside the code block of a function in which it was declared and initialized because the variable is hidden and unavailable outside the code block.
► Variables defined outside a function don't affect variables defined inside a function unless your code returns the inside value and then uses it.

WATCH MORE PYTHON TUTORIALS 🐍
   • 🐍 Python Coding for Beginners  

For the setup, please read the followings before you begin:
1. Download latest Python: https://www.python.org/downloads/
2. Install Python and remember to select "Add Python... to PATH" when asked.
3. Download and install latest Visual Studio Code: https://code.visualstudio.com/Download
4. Install the Python extension for Visual Studio Code: Go to View and select Extensions, or select the Extensions icon, then search for python.

Python - a programming language used by world-class companies such as Amazon.com, Alphabet (Google), Facebook, Twitter, and NASA.

👇 SUBSCRIBE TO CODING WITH KIDS 👨🏻‍💻👩🏻‍💻 YOUTUBE CHANNEL NOW 👇
https://youtube.com/CodingWithKids?su...

#CodingWithKids #PythonProgramming #PythonForBeginners


Auf dieser Seite können Sie das Online-Video How to Code PYTHON: *Return Function and Variable Scope in Python* mit der Dauer online in guter Qualität ansehen, das der Benutzer Coding With Kids 27 Januar 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 196 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!