I was trying to pass two variables returned from one function to the next function but but I'm not really understanding what am I missing, i always get the error -
TypeError: Function2() takes exactly 2 arguments (0 given)
My Code:
Function1(arg1, arg2):
# This two args to this function are taken from the user and some work is done here and this function will return two things as output (my_list1 is a list) -
return my_list1, count
Function2 (argg1, argg2):
# This function will get the first and second argument from the previous function (Function1)
def main():
Function1(list1, count1)
myfinal_list, final_count = Function1()
Function2(myfinal_list, final_count)
if __name__== "__main__":
main()
How can I achieve this? What would I have to do to make sure data from the first function will be sent to the second function? Thank you!
Function1()without any arguments? Domyfinal_list, final_count = Function1(list1, count1)