Created
February 22, 2019 18:51
-
-
Save BurhanH/e6466dd7987e543813b62b1403fbfecd to your computer and use it in GitHub Desktop.
string concatenation examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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