#Python #Shorts
It is somewhat common to have functions that have arguments that are optional. To create such a function, your arguments need default values. To achieve that, just set the default value right in the function definition. Be careful though, optional arguments MUST appear after all other arguments. And lastly, don't ever use mutable types, such as lists, as default arguments. Use None instead.
-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter: / evgenyurubkov
Instagram: / evgenyurubkov
Youtube: / @codevev
In questa pagina del sito puoi guardare il video online Python - Functions with Optional Arguments della durata di ore minuti seconda in buona qualità , che l'utente ha caricato codevev 10 giugno 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 502 volte e gli è piaciuto 11 spettatori. Buona visione!