Set the number range to quickly generate random numbers in batches. Provides random number generation functions for a variety of programming languages.
Language | How to generate random number |
---|---|
Java | Math.random()*10 |
PHP | rand(0,10) |
JavaScript | Math.floor(Math.random()*10) |
Python | random.randint(0,10) |
Go | fmt.Println(rand.Intn(100)) |
OC | arc4random_uniform(10 + 1) |
Swift | arc4random() % 10 + 1 |
Copyright © 2018 - 2024 ToolPie. All rights reserved