Qurak

Get elements of lists

Guida pratica 9 passi, eseguiti in ordine in una sola sessione. Ogni passo è stato eseguito sul motore e l'output qui sotto è ciò che ha prodotto.

Passo 1
v = Range[10] ^ 2
Output
{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}
Passo 2
Part[v, 3]
Output
9
Passo 3
v[[3]]
Output
9
Passo 4
v[[1 ;; 5]]
Output
{1, 4, 9, 16, 25}
Passo 5
v[[5 ;; 8]]
Output
{25, 36, 49, 64}
Passo 6
v[[-7 ;; ]]
Output
{16, 25, 36, 49, 64, 81, 100}
Passo 7
m = Partition[Range[25] ^ 2, 5]
Output
{{1, 4, 9, 16, 25}, {36, 49, 64, 81, 100}, {121, 144, 169, 196, 225}, {256, 289, 324, 361, 400}, {441, 484, 529, 576, 625}}
Passo 8
MatrixForm[m]
Output
MatrixForm[{{1, 4, 9, 16, 25}, {36, 49, 64, 81, 100}, {121, 144, 169, 196, 225}, {256, 289, 324, 361, 400}, {441, 484, 529, 576, 625}}]
Passo 9
m[[1]]
Output
{1, 4, 9, 16, 25}

Funzioni usate

Ricette correlate

Tutte le ricette · Guida delle funzioni · Usa questo da un client MCP