Skip to content

Instantly share code, notes, and snippets.

@xkumiyu
Created March 25, 2020 05:59
Show Gist options
  • Save xkumiyu/67bf06ac10f0e32d38a865348f088b60 to your computer and use it in GitHub Desktop.
Save xkumiyu/67bf06ac10f0e32d38a865348f088b60 to your computer and use it in GitHub Desktop.
# append()
A = []
for i in range(N):
A.append(i)
# A[i] = i, assignment
A = [None] * N
for i in range(N):
A[i] = i
# [i for i in range(N)], comprehension
A = [i for i in range(N)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment