(Python 3-2๊ฐ) Pythonic code
210803
Pythonic Code
>>> colors = ['red', 'blue', 'green', 'yellow']
>>> result = ''
>>> for s in colors:
result += s
>>> colors = ['red', 'blue', 'green', 'yellow']
>>> result = ''.join(colors)
>>> result
'redbluegreenyellow'Split
Join
List Comprehension
Enumerate
Zip
Lambda
Map
Reduce
Function passing arguments
Last updated