Why doesn’t the following code work;?


#1

Why doesn’t the following code work;?
def create_spreadsheet(title,row_count):
print(“Creating spreadsheet called " + title + " with” + str(row_count) + " rows."
create_spreadsheet(“Downloads”, 1000)


FAQ: Introduction to Functions - Keyword Arguments
#2

Is it not being accepted in a lesson? Which lesson? Please post the URL of the exercise page.

The problem could be as simple as a missing space in the concatenation.


#3

Hi,
I am stuck at the first step of this lesson: https://www.codecademy.com/paths/computer-science/tracks/cspath-intro/modules/cspath-python-functions/lessons/intro-to-functions/exercises/keyword-arguments

the code so far: def create_spreadsheet(title)
print(“Creating spreadsheet called " + title)

def create_spreadsheet(title) returns a syntax error:invalid syntax. Is this a possible bug?


#4

Do you have a colon (:slight_smile: at the end of the def line? It doesn’t show in your message text.


#5

That was exactly the problem, forgot the colon, thank you very much!


#6

Thanks for the help, Roy. It worked when I went back into it.


#7

im having trouble wit the next part of the code its saying to call create_spreadsheet with a title of Downloads but when i do that i get the did you call create_spreadsheet() with Downloads as an argument msg

def create_spreadsheet(title):
print("creating a spreadsheet called "+title)

create_spreadsheet(“Downloads”)

can someone help me understand what i am doing wrong please thank you