What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-03 21:30:13
roll dice python
from random import randint def roll_dice(): print(f"Number is: {randint(1,6)}") # Do this to simulate once roll_dice() # Do this to simulate multiple times whatever = 12 # Put the number of times you want to simulate here for number in... Add solution -
C++ 2021-11-02 14:16:14
dice game c++ with standard deviation
#include<iostream> #include<cstdlib> #include<ctime> #include<iomanip> #include<vector> #include<cmath> #include<algorithm> int main( ) { std::cout << "enter seeding number: " ; int num... Add solution -
Python 2021-10-30 06:08:10
what is a tuple 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 -
Ruby 2021-10-30 01:51:08
Ruby Array.new syntax
Array.new( number of indices, value of the indices ) { optional block for value of indices } ary = Array.new #=> [] Array.new(3) #=> [nil, nil, nil] Array.new(3, true) #=> [true, true, true] Array.new(3) { Hash.new } #=> [ {}, {}, {} ] Add solution -
Java 2021-10-29 16:27:12
code java qui implementation du tri fusion
public static void triFusion (int [] tab, int début, int fin) { int milieu; if(début < fin) { milieu = (début+fin) / 2; triFusion(tab, début, milieu); triFusion(tab, milieu + 1, fin); fusionner (tab, début,... Add solution -
Javascript 2021-10-28 10:21:06
iterate through an 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 -
Other 2021-10-28 08:08:13
jacascript loop 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
Best helpers
Michaelyus
+5
EBA2018
+5
Eric Lewis
+5
J. Tatum
+5
Erwaman
+5
Jp_
+5
Fauve
+5
Katy Forde
+5
Jcvamp
+5
Chris
+5
Xiaotian Pei
+5