Python Coding Basics for Beginners #6 - Functions

Опубликовано: 10 Июль 2024
на канале: 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!!


На этой странице сайта вы можете посмотреть видео онлайн Python Coding Basics for Beginners #6 - Functions длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь BruvCode 10 Июль 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 10 раз и оно понравилось 0 зрителям. Приятного просмотра!