What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-13 09:05:20
loop through array javascript
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Lua 2021-11-12 20:23:31
dice roll to add total to array lua
local function comp(ndice1, nsides1, ndice2, nsides2) local function throws(ndice, nsides) local sums = {} for i = 1, ndice*nsides do sums[i] = 0 end local function throw(ndice, nsides, s) if (ndice==0) then sums[s] = s... Add solution -
Javascript 2021-11-12 18:05:16
javascript through array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Python 2021-11-12 04:21:15
make a tuple of any object in python
# A tuple is a sequence of immutable Python objects. Tuples are # sequences, just like lists. The differences between tuples # and lists are, the tuples cannot be changed unlike lists and # tuples use parentheses, whereas lists use square brackets. tup1 =... Add solution -
Other 2021-11-06 04:35:16
Caricato un vettore V1, costruire un vettore V2 le cui componenti di indice pari sono quelle di indice pari del vettore V1 e quelle di indice dispari sono quelle di indice dispari del vettore V1 moltiplicate per tre
Caricato un vettore V1, costruire un vettore V2 le cui componenti di indice pari sono quelle di indice pari del vettore V1 e quelle di indice dispari sono quelle di indice dispari del vettore V1 moltiplicate per tre Add solution -
Java 2021-11-05 02:42:08
javascript loop through arra
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Python 2021-11-04 10:31:09
assign each point to the cluster with the closest centroid python
def kmeans(X, k, maxiter, seed = None): """ specify the number of clusters k and the maximum iteration to run the algorithm """ n_row, n_col = X.shape # randomly choose k data points as initial centro... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5