filmov
tv
Python keyword arguments are awesome! 🗝️
![preview_player](https://i.ytimg.com/vi/7QCHpAtlSMo/maxresdefault.jpg)
Показать описание
#python #tutorial #course
00:00:00 example 1
00:03:20 example 2
00:04:36 exercise
00:06:19 conclusion
# keyword arguments = arguments prefixed with the names of parameters
# order of the arguments doesn’t matter
# helps with readability
# ----- EXAMPLE 1 -----
def hello(greeting, title, first, last):
print(f"{greeting} {title}{first} {last}")
hello("Hello", title="Mr.", last="John", first="James")
# ----- EXAMPLE 2 -----
for number in range(1, 11):
print(number, end=" ")
print("1", "2", "3", "4", "5", sep="-")
# ----- EXERCISE -----
def get_phone(country, area, first, last):
return f"{country}-{area}-{first}-{last}"
phone_num = get_phone(country=1, area=123, first=456, last=7890)
print(phone_num)
00:00:00 example 1
00:03:20 example 2
00:04:36 exercise
00:06:19 conclusion
# keyword arguments = arguments prefixed with the names of parameters
# order of the arguments doesn’t matter
# helps with readability
# ----- EXAMPLE 1 -----
def hello(greeting, title, first, last):
print(f"{greeting} {title}{first} {last}")
hello("Hello", title="Mr.", last="John", first="James")
# ----- EXAMPLE 2 -----
for number in range(1, 11):
print(number, end=" ")
print("1", "2", "3", "4", "5", sep="-")
# ----- EXERCISE -----
def get_phone(country, area, first, last):
return f"{country}-{area}-{first}-{last}"
phone_num = get_phone(country=1, area=123, first=456, last=7890)
print(phone_num)
Python keyword arguments are awesome! 🗝️
Python *ARGS & **KWARGS are awesome! 📦
Python - Keyword Arguments
Python keyword arguments 🔑
Python default arguments are awesome! 👍
Python Arguments in Functions (Positional, Keywords & Default Arguments) #13
Python Programming Tutorial - 16 - Keyword Arguments
#35 Python Tutorial for Beginners | Keyworded Variable Length Arguments in Python | **kwargs
#33.Introduction to functions in python
Beginner Python Tutorial 90 - Keyword Arguments
This Is When Keyword Arguments Are Really Useful // Python Tips
Positional vs. keyword arguments - How to Python - Basics 14
*args and **kwargs in Python | Python Tutorials for Beginners #lec62
63. Python - Funkce s více parametry, positional a keyword arguments
Positional-only and keyword-only arguments in Python
But what are Python *ARGS & **KWARGS?
Types of Arguments in Python | Python Tutorials for Beginners #lec61
De functie print() & het keyword argument “sep”
Keyword Arguments Function in Python | Python Tutorial for Beginners | Naresh IT
*args & **kwargs in Python - Accept Unlimited Arguments
#34 Python Tutorial for Beginners | Types of Arguments in Python
Beginner Python Tutorial 84 - Arguments and Parameters
Tutorial 12- Python Functions, Positional and Keywords Arguments
Most parameters should be passed as keyword arguments
Комментарии