Тёмный

The Python return Statement: Implicit and Explicit return 

Real Python
Подписаться 189 тыс.
Просмотров 14 тыс.
50% 1

The Python return statement is a key component of functions and methods. You can use the return statement to make your functions send Python objects back to the caller code. These objects are known as the function’s return value. You can use them to perform further computation in your programs.
You'll learn about implicit vs explicit returns, and the differences in printing vs returning values or objects.
Click here for more info about the complete course: realpython.com/courses/effect...

Опубликовано:

 

6 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@pile333
@pile333 2 года назад
Very clear.
@mrjt6404
@mrjt6404 2 года назад
Thank you so much what would return -1 do ???
@REALtierope
@REALtierope 2 года назад
you can use return -1 to make a function which can change the sign of a number if you multiply by -1. like change_sign() * 5 would give you -5 and an input of -3 will give you 3
@AhmedMWafi-ds5do
@AhmedMWafi-ds5do 2 года назад
Great videooooo
@15youngblack
@15youngblack 2 года назад
I'm confused about when you start to bring up list comprehension. num%2 for an even number is 0, which is what we want. So why is that not enough to satisfy the equation?
@coldCoders
@coldCoders 11 месяцев назад
I wish they explained this as well. I feel like it was just, "type in "not" and your good to go, w/o an explanation as to why"
@coldCoders
@coldCoders 11 месяцев назад
Really wish expanations of why to place not, what is the for, in and if statements etc. Rather than just "do this because it works". idk something more in depth and explains certain things rather than, b/c it is 0 we need the Not operator sos type in not. okay so? thatdoesnt teach me anything.
@styledox6879
@styledox6879 11 месяцев назад
confusing for a beginner
Далее
Defining Functions in Python
27:54
Просмотров 9 тыс.
Best Practices for Python Main Functions
11:17
Просмотров 182 тыс.
Макс Пэйн - ТРЕШ ОБЗОР на фильм
47:02
Python Decorators in 15 Minutes
15:14
Просмотров 429 тыс.
You Can Do Really Cool Things With Functions In Python
19:47
Return vs Print - Python
10:25
Просмотров 13 тыс.
Defining Python Data Classes
17:29
Просмотров 14 тыс.
How To Use Functions In Python (Python Tutorial #3)
14:55
15 Python Libraries You Should Know About
14:54
Просмотров 370 тыс.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Functions in Python are easy 📞
10:38
Просмотров 411 тыс.