[Python] 리스트 - List
ten = [i for i in range(10)] print(ten) #[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] odd = [i for i in range(20) if i % 2 == 1] print(odd) #[1, 3, 5, 7, 9, 11, 13, 15, 17, 19] sqrt = [i * i for i in range(1, 10)] print(sqrt) #[1, 4, 9, 16, 25, 36, 49, 64, 81] n , m = 4, 3 array = [[0]* m for _ in range(n)] print(array) #[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]] summary = 0 for i in range(1,10): summary +=..
Python/이코테
2022. 6. 1. 03:36