Computer Science/알고리즘 ( Algorithm )
[python] list 가지고 놀기
bugtype
2018. 12. 22. 13:28
numberList = list([x for x in range(1,10)])
numberList2 = list([str(x) for x in range(1,10) if x % 2 == 0])
numberList3 = list(map(lambda x: x+3, numberList))
numberList4 = [1,2] + numberList
print(numberList)
print(numberList2)
print(numberList3)
print(numberList4)
[1, 2, 3, 4, 5, 6, 7, 8, 9]
['2', '4', '6', '8']
[4, 5, 6, 7, 8, 9, 10, 11, 12]
[1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9]