Si vous souhaitez l'exprimer sous forme de tableau NumPy, omettez-le car il peut être converti avec np.array ().
Disposition de NumPy
l = [[1, 2, 3], [4, 5, 6]]
l = np.array(l)
# l = [[1 2 3][4 5 6]]
contribution | code | Remarques |
---|---|---|
a | s = input() | |
1 | s = int(input()) | |
a b c | s = list(input().split()) x, y, z = input().split() |
|
1 2 3 | n = list(map(int, input().split())) x, y, z = input().split() |
|
3 a b c |
n = int(input()) l = [input() for i in range(n)] |
|
3 1 2 3 |
n = int(input()) l = [int(input()) for i in range(n)] |
|
2 3 a b c d e f |
n, m = map(int, input().split()) l = [list(input().split()) for i in range(n)] --- n, m = map(int, input().split()) l = sum([list(input().split()) for i in range(n)], []) |
Format imbriqué et plat |
2 3 1 2 3 4 5 6 |
n, m = map(int, input().split()) l = [list(map(int, input().split())) for i in range(n)] --- n, m = map(int, input().split()) l = sum([list(map(int, input().split())) for i in range(n)], []) |
|
3 2 1 a 2 b 3 c |
n, m = map(int, input().split()) l = [] for i in range(n): x, y = input().split() l.append([int(x), y]) |
|
3 1 2 3 4 5 6 7 8 9 10 11 12 |
n = int(input()) l = [list(map(int, input().split())) for i in range(n)] graph = {} for i in range(n): graph.setdefault(str(l[i][0]), []).append(l[i][1:]) print(graph) |
Obtenez au format graphique |
Recommended Posts