2014-04-09 14:17:53 -04:00
|
|
|
print(','.join(()))
|
|
|
|
print(','.join(('a',)))
|
|
|
|
print(','.join(('a', 'b')))
|
|
|
|
|
|
|
|
print(','.join([]))
|
|
|
|
print(','.join(['a']))
|
|
|
|
print(','.join(['a', 'b']))
|
|
|
|
|
|
|
|
print(''.join(''))
|
|
|
|
print(''.join('abc'))
|
|
|
|
print(','.join('abc'))
|
|
|
|
print(','.join('abc' for i in range(5)))
|
2014-05-11 14:13:01 -04:00
|
|
|
|
|
|
|
print(b','.join([b'abc', b'123']))
|
|
|
|
|
2017-03-04 06:34:58 -05:00
|
|
|
try:
|
|
|
|
''.join(None)
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
|
2014-05-11 14:13:01 -04:00
|
|
|
try:
|
|
|
|
print(b','.join(['abc', b'123']))
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
|
|
|
|
try:
|
|
|
|
print(','.join([b'abc', b'123']))
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
2015-03-12 18:47:44 -04:00
|
|
|
|
|
|
|
# joined by the compiler
|
|
|
|
print("a" "b")
|
2017-02-16 20:30:27 -05:00
|
|
|
print("a" '''b''')
|
|
|
|
print("a" # inline comment
|
|
|
|
"b")
|
|
|
|
print("a" \
|
|
|
|
"b")
|
|
|
|
|
|
|
|
# the following should not be joined by the compiler
|
|
|
|
x = 'a'
|
|
|
|
'b'
|
|
|
|
print(x)
|