0

Is python has procedure feature ? Is variable hello is a procedure or a function ?

def fib(n): a, b = 0, 1 while a < n: a, b = b, a+b num = 10 fib(num) hello = fib

3rd Jun 2021, 12:21 PM
lisa
2 Respostas
+ 2
procedure and function are often used interchangeabily ;P even method and function are not so often distinguished ^^ in python context, as far as I know, we never (or rarely) use the term 'procedure'... you could consider that both are same ;) and that 'hello' is also a / the same function than fib...
3rd Jun 2021, 12:34 PM
visph
visph - avatar
+ 4
the differentiation of function and procedure is a specific issue of the pascal language: ▪︎procedure does not have any return value ▪︎function needs to have a return value in the majority of all programming languages we are talking about functions.
3rd Jun 2021, 3:33 PM
Lothar
Lothar - avatar