Python - Concatenating a String With a Variable
Code:
listOfStrings = [ "Hello" Code:
HELLOWORLDWHEREHAVEYOUBEEN Thank you for your help. |
Because Python, like C, automatically concatentates strings that are separated only by whitespace.
For a list of strings, you need commas. Code:
["a", "b", "c"] |
dugan,
Thank you! If I'm not mistaken, the book I'm working through advised me that they needed to be separated by commas. Should have been blatantly obvious. Actually, I guess it was to you. To me? Not so much. |
Quote:
Code:
listOfStrings = [ "Hello", Code:
for i in range(len(listOfStrings)): Code:
for i in listOfStrings: |
Code:
print "\n".join(listOfStrings).upper() |
All times are GMT -5. The time now is 03:43 PM. |