Hello, and welcome back to another Python Basics tutorials, and today, we'll be doing functions, if you're new here and want to know how to code, Please LIKE and SUBSCRIBE RIGHT NOW, because I'll be explaining everything we did in the previous tutorials such as Input and Conditional Statements, Variables and everything we did. A function is a sequence of commands that can be re-used in a program later on. It's possible to make a function. To make a function, it has to be defined first. You can make your own function like the example below this description
This is a simple function that prints hi to the person. First define it by using the `def` keyword which comes with Python by default.
```
Defining a function to print hi to the person
def print_hi(name): # Using the name parameter
print hi to the person
print("Hi", name)
Now testing the function
print_hi("Federico")
Output:
====================
Hi Federico
```
It displays "Hi" with the name entered in the parameters. You can use them for all sorts of things through out a program. You can make your own function, and use it multiple times throughout a program. Once defined, you can add required parameters if you want to, and use it. They can often work with variables, strings (text) and integers or floats.
============================================
Click to Subscribe! - / @bruvcode
Beginner Tutorial Series - • Python Basics for Beginners Tutorials
Thanks for watching!
Stay tuned: By SUBSCRIBING and ENABLING NOTIFICATIONS for new videos
LIKE this video
Any questions, suggestions or feedback, leave it in the COMMENT SECTION below
See you in the next video
SUBSCRIBE, Help me reach 10,000 SUBSCRIBERS!!
Auf dieser Seite können Sie das Online-Video Python Coding Basics for Beginners #6 - Functions mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer BruvCode 10 Juli 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 10 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!