“Integer acak” Kode Jawaban

Int acak numpy

np.random.randint(2, size=10) # Creates binary sample of size 10
np.random.randint(5, size=10) # Creates sample with 0-4 as values of size 10

np.random.randint(5, size=(2, 4))
Comfortable Cockroach

Menghasilkan bilangan bulat acak

Math.floor(Math.random()*10)
Javasper

Integer acak

import random
a = random.randint(0,10) #generates a random number between 1 to 10
print(a)
Psycho AnKy

Generator int acak

Random rnd = new Random();
int month  = rnd.Next(1, 13);  // creates a number between 1 and 12
int dice   = rnd.Next(1, 7);   // creates a number between 1 and 6
int card   = rnd.Next(52);     // creates a number between 0 and 51

Jawaban yang mirip dengan “Integer acak”

Pertanyaan yang mirip dengan “Integer acak”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya