Funcao(param = 'value')
is a function that has a argument default, ie if the argument is not passed in the call of Funcao
, the value 'value'
shall be assigned to the parameter param
.
Funcao(value)
I put in the Github for future reference.
In this case the parameter calls value
, he is in the place of param
, in the background parameters are local variables, the only difference is that they will be initialized in the function call. In this if you do not pass an argument on the call of Funcao
the variable value
shall have a null value (None
).
Could be using in another context and there value
can be a variable called value
which is being passed on to Funcao()
as an argument.
Funcao(u'value')
is a string in Unicode encoding, nothing to do with the parameter, but it is an argument being passed, this cannot be the function statement, it has to be the call.
Without the context in each can not be sure so I gave the options.
Can you clarify if your doubt consists in the definition of a function or if it is in its call? And where did you see this
p'value'
? Particularly I do not know this prefix. There areu
,r
,f
andb
that I know, butp
never seen. Including thep
nor in the official documentation.– Woss
@Andersoncarloswoss It was u, but I put p because I thought it was named randomly. I will correct.
– Seu Madruga