What are these (/ and *) parameters in function? 2MinutesPy

preview_player
Показать описание
#function #python #pythonprogramming #2minutespy

🖐Hey, have you ever wondered why the slash and asterisk are used in a function definition? What are their roles?

🐍In this beginner-friendly video, we'll explore why the slash and the asterisk are used in a function definition. What are they supposed to do? Does a function gain superpower by using these?

More 2 Minutes Python Tutorial:

@2MinutesPy
Рекомендации по теме
Комментарии
Автор

Thanks for another video!
In your experience, what are some use cases for the / and * in this context?

olgakar
Автор

What happens with the self parameter of class methods?

SantiagoKus
Автор

So what is to the left side of the / is positional-only and what is to the right side of * is keyword-only

guilhermecampos
Автор

I remember when I saw this in a codebase for the first time and thought it was an error 😂. Such a cool feature, even if the implementation is a bit odd looking

charlesbcraig