Suppose I have the following list:
temp = ['Ok', 'Whoa. Robot?']
How do I get a string that looks like
"1) 'Ok', 2) 'Whoa. Robot?'"
I'm trying to do this for a list comprehension. I can obviously join them using:
" ".join(temp)
I can do it in a loop in a fairly ugly way:
mystring = ""
temp = ['Ok', 'Whoa. Robot?']
for i in range(len(temp)):
mystring += str(i) + ") " + temp[i] + " "
Is there a pythonic way to do it in one step with a list comprehension?