例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
# 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 |
# for i in range(len(A)) | |
for i in range(len(A)): | |
A[i] | |
# for a in A | |
for a in A: | |
a |
# faster | |
[[None] * N for _ in range(N)] | |
# slower | |
[[None for _ in range(N)] for _ in range(N)] | |
# NG | |
[[None] * N] * N |
# [None] * N | |
[None] * N | |
# [None for _ in range(N)] | |
[None for _ in range(N)] |
# for _ in range(N) | |
for _ in range(N): | |
pass | |
# for i in range(N) | |
for i in range(N): | |
i | |
# while i < N | |
i = 0 |
# sort, lambda | |
A.sort(key=lambda x: x[1]) | |
# sort, itemgetter | |
from operator import itemgetter | |
A.sort(key=itemgetter(1)) | |
# sorted, lambda | |
A = sorted(A, key=lambda x: x[1]) |
# sort() | |
A.sort() | |
# sorted() | |
A = sorted(A) |
# input() | |
N = int(input()) | |
A = [int(input()) for _ in range(N)] | |
# sys.stdin.readline() | |
import sys | |
input = sys.stdin.readline | |
N = int(input()) | |
A = [int(input()) for _ in range(N)] |
以下転載:
import argparse | |
import gzip | |
import pathlib | |
import struct | |
import numpy as np | |
import pandas as pd | |
import requests | |
from PIL import Image |