Thursday, Jun 27, 2024 at 10:22 AM

Python: Concatenating strings

Method 4: Build a list of strings, then join it

def method4():
  str_list = []
  for num in xrange(loop_count):
    str_list.append(`num`)
  return ''.join(str_list)

You'll only receive email when they publish something new.

More from Leo Ju
All posts