+ 4
Python functions
def count(): does the above syntax make sense?
22 Answers
+ 2
Function are so much easier to get arguments and different things
+ 1
Yes this is function it's call whenever you need without arguments.
+ 1
Any function makes sense only when it is called
+ 1
Function attributes and function arguments are two different things.
function attributes
def fun():
pass
fun.__doc__ or fun_doc
fun.__dict__ or fun_dict etc..
function arguments
def fun(a,b): // a, b are arguments
pass
But yes you can have function with no arguments and no values for attributes (__doc__ string or __dict__ remains empty)
+ 1
Thank 😍
0
@swim, can you please explain attributes and arguments in detail? in def fun(a,b) a and b are arguments....which are attributes???
0
@swim .....yes please
0
got it thank you so much
0
+return
0
bruh this useless no cool no pog
0
ok
0
def fun():
fun_doc
Or
fun_dict
0
Function can overlap other function or take text, char and variables
- 1
.
- 2
No, there must be some code after the function is defined.
- 2
@aymane and @swim,
sorry for not describing my question, can we have no attributes in function? is my question
- 2
Yes you can, def count(): pass
Is a function that does nothing, no attributes or arguments are required.
- 3
It will be easier to understand attributes after studying classes, don't rush it. However,if you still want to just ask again.