128k views
1 vote
Which block of code will have the computer pick a random number between the minimum and max you set?

User Buzibuzi
by
8.2k points

1 Answer

2 votes

Final answer:

To generate a random number between a set minimum and maximum, use a function like randint in Python or randInt on a calculator, with the min and max range values as arguments.

Step-by-step explanation:

To have the computer pick a random number between a set minimum and maximum, you would typically use a random number generator function available in most programming languages. For example, in Python, you can use the randint function from the random module to generate a random number within a specified range. The usage is as follows:

import random
random.randint(min, max)

Here, 'min' represents the minimum value of the range, and 'max' represents the maximum value. If you're using a calculator that supports programming, there might be a built-in function such as randInt(), where you also input the minimum and maximum range to generate a random number. As mentioned earlier, a common method is to use the randInt command, which could look like randInt(min, max) in the calculator's syntax.

User Irishka
by
7.0k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.