We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm also trying to understand this, and am picking it appart one piece at a time.
---------------Number one--------------
cmd+=
here he is appending some text to the 'command' string that gets evaluated later in the code.
---------------Number two--------------
cmd+="("+",".join(args)+")"
Here the brackets on the far left and right sides have quotes around them because he is trying to construct the part where the two numbers(arguments) are used by the function. The comma also has quotes because it is needed between those two numbers.
the plus signs simply join the pieces of text together, and the .join(args) is used to insert the numbers into the argument section of the function.
my problem in understanding is that I would have assumed that the .join(args) would need to be written befor and after the comma in that line of text.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
I'm also trying to understand this, and am picking it appart one piece at a time. ---------------Number one--------------
here he is appending some text to the 'command' string that gets evaluated later in the code.
---------------Number two--------------
Here the brackets on the far left and right sides have quotes around them because he is trying to construct the part where the two numbers(arguments) are used by the function. The comma also has quotes because it is needed between those two numbers.
the plus signs simply join the pieces of text together, and the .join(args) is used to insert the numbers into the argument section of the function.
my problem in understanding is that I would have assumed that the .join(args) would need to be written befor and after the comma in that line of text.