Python Coding Basics for Beginners #6 - Functions

Pubblicato il: 10 luglio 2024
sul canale di: BruvCode
10
0

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!!


In questa pagina del sito puoi guardare il video online Python Coding Basics for Beginners #6 - Functions della durata di ore minuti seconda in buona qualità , che l'utente ha caricato BruvCode 10 luglio 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 10 volte e gli è piaciuto 0 spettatori. Buona visione!