Skip to content

Instantly share code, notes, and snippets.

@BurhanH
Created February 22, 2019 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BurhanH/e6466dd7987e543813b62b1403fbfecd to your computer and use it in GitHub Desktop.
Save BurhanH/e6466dd7987e543813b62b1403fbfecd to your computer and use it in GitHub Desktop.
string concatenation examples
# -*- coding: utf-8 -*-
nums = [str(n) for n in range(10)]
print("".join(nums))
# 0123456789
foo = 'foo'
bar = 'bar'
foobar = '{foo}{bar}'.format(foo=foo, bar=bar)
# foobar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment