I am getting an error and I want a fix .-.

Here is the link - https://repl.it/@MATTHEWBECHTEL/Ffncehjanddfkicysbjizdpch3pco
It says SyntaxError: EOL while scanning string literal
As stated in the screenshot below

You are viewing a single comment. View All
Answered by JustARatherRidi (191) [earned 5 cycles]
View Answer
heyitsmarcus (287)

@MATTHEWBECHTEL The comma separates parameters given to functions and the parameters themselves. In your first function, you had only one parameter, so there are no commas needed to separate any other parameters.


def write(string):
#and then in every function call...
#only one parameter, which is string
write("I am bob the robot.")

But, when you add more parameters, you separate them by commas inside the function. The way you are writing it, you have to overwrite the function every single time you want to change the timing. What I showed you is a way to not do that. It's the way that everyone else is going to use because not only is it more efficient but it's more readable.

#two parameters, separate them by commas
def write(string, fltime):
#and then in every function call...
#there are two parameters
#first one is the string to use
#second one is the timing to use for this write statement
write("I am bob the robot.", 0.03)

Does that make sense? Also, please upvote these comments because I'm spending a lot of time helping you lol.