today i have learned about *args.
the term was that it is used in a function if i don’t know the number of arguments i would have.
but i just don’t understand what is the different between args , and if i create a function without parameters at all ?
collecting data? i can just create an empty list and keep adding the user inputs into it and print whenever he want….
to me it look like that:
if i dont know the number of arguments :
def the_fuck_is_args():
if i do know the number of arguments:
def why_args_alive(list1,list2)
so what’s the point of:
def who_let_the_args_out(ohoh,*args)
chatgpt made it even worse for me , I’m 80% more confused then before
thanks guys!
submitted by /u/ConsistentEnd9423
[link] [comments]
r/learnpython today i have learned about *args. the term was that it is used in a function if i don’t know the number of arguments i would have. but i just don’t understand what is the different between args , and if i create a function without parameters at all ? collecting data? i can just create an empty list and keep adding the user inputs into it and print whenever he want…. to me it look like that: if i dont know the number of arguments : def the_fuck_is_args(): if i do know the number of arguments: def why_args_alive(list1,list2) so what’s the point of: def who_let_the_args_out(ohoh,*args) chatgpt made it even worse for me , I’m 80% more confused then before thanks guys! submitted by /u/ConsistentEnd9423 [link] [comments]
today i have learned about *args.
the term was that it is used in a function if i don’t know the number of arguments i would have.
but i just don’t understand what is the different between args , and if i create a function without parameters at all ?
collecting data? i can just create an empty list and keep adding the user inputs into it and print whenever he want….
to me it look like that:
if i dont know the number of arguments :
def the_fuck_is_args():
if i do know the number of arguments:
def why_args_alive(list1,list2)
so what’s the point of:
def who_let_the_args_out(ohoh,*args)
chatgpt made it even worse for me , I’m 80% more confused then before
thanks guys!
submitted by /u/ConsistentEnd9423
[link] [comments]