String format printing with python3: How to print from array?
问题 Python3 has the super string.format printing: '{} {}'.format('one', 'two') If my strings are in an array, one way would be to type them out: a = ['one','two'] '{} {}'.format(a[0],a[1]) But how can I print from an array, instead of having to type out each element? For example, broken code: a = ['one','two'] '{} {}'.format(a) Gives me an expected error: IndexError: tuple index out of range Of course, playing with ','.join(a) won't help, because it gives one string rather than 2. (Or is there a