def test (numberList): result=[] for number in numberList: result.append(number*2) return result >> list(map(test,[1,2,3,4])) >> list(map(lambda a:a*2, [1,2,3,4]))
: ๋ฆฌ์คํธ ๋ฐฐ์ด์ด ๋ชจ๋ ๋ฌธ์์ด์ด์ด์ผํจ.
๋ง์ฝ ๋ฆฌ์คํธ ๋ฐฐ์ด์ด ์ ์ํ์ผ ๊ฒฝ์ฐ ๋ฆฌ์คํธ ์ ์ํ์ ๋ฆฌ์คํธ ๋ฌธ์์ด๋ก ๋ณํ ํ ๋ฌธ์์ด๋ก ๋ฐ๊พผ๋ค.
a=['1','2','3'] string=''.join(a) b=[1,2,3] print(''.join(str(_) for _ in b))