Quick question pertaining to the Codecademy Unit 2 String Concatenation exercise: I noticed that when you're combining strings with addition you have to space the ending quotation once following the last letter of the (str) before your "+" (e.g., "Sweet " + "Apple " + "Pie") Why is that? And in what other instances is this a necessity?
Because it would just "glue" together. The result would be "SweetApplePie" if you wouldn't put spaces (you can just try and see yourself the result). The necessity is in all instances where you need to get correct sentence (not words "glued" together).
Okay. That sums it up pretty well. I just don't recall it specifically stating that it had to be written out like that, but I may have overlooked it. I was stuck on the date and time exercise for a while because I thought I needed the spaces there as well. It simply needed the forward slashes. It's past my bedtime. Thank you for the assistance.
You could also do: ("Sweet" + " " + "Apple" + " " + "Pie") its your choice. Good night :)
That will be useful in the future. Good to know there's at least a little flexibility. Again, thank you, and goodnight :)
Join our real-time social learning platform and learn together with your friends!