Learning about functions and arguments, My confusion is that I understand when you use a keyword argument, you’re giving a parameter a specific value, for example…
# Define create_spreadsheet(): def create_spreadsheet(title, row_count=1000): print("Creating a spreadsheet called "+title + " with " +str(row_count) +" rows") # Call create_spreadsheet() below with the required arguments: create_spreadsheet("Applications",10)
So in the function, as instructed, I’ve added the parameter “row_count” and gave it a default value of 1000, as you see when the function is called the value given for “row_count” is 10, and it works, showing the print line with the value of 10.
My question, How does that work, giving a different value when you call the function when in the function itself you’ve already given a specified and default value of 1000, how then does it work or what’s the point of giving a specific value if you can just change it to whatever you want when you call that function?
If the specified value for that parameter is 1,000, then shouldn’t it be a 1,000 every time it runs the function? Why am I able to make a specific default value for a parameter and then change it when I call that function?