Python Initialize Array (List)

February 24, 2019
nums = []
nums = [0]*5 # 0, 0, 0, 0, 0
nums = [1, 2, 3, 4, 5]
nums = list(range(1, 5+1)) # 1, 2, 3, 4, 5
nums = [chr(65+i) for i in range(5)] # A, B, C, D, E
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.